slack

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GetEmojiMatches = func(emoji string, keywords []string, text string, emojis []string) []string {
	for _, keyword := range keywords {
		if strings.Contains(strings.ToLower(text), strings.ToLower(keyword)) && !common.ArrayContainsItem(emojis, emoji) {
			emojis = append(emojis, emoji)
		}
	}
	return emojis
}
View Source
var GetKeyWordsMap = func() (keywordsMap map[string][]string) {
	return map[string][]string{
		"kubernetes": {"kube", "kubernetes", "k8s"},
		"docker":     {"docker", "containers", "container"},
		"aws":        {"aws", "lambda", "ec2", "cloudwatch", "codebuild", "kinesis streams", "redshift", "appsync", "ebs", "elasticsarch", "amazon", "s3"},
		"aww-yeah":   {"congratulations", "daami", "way to go", "hurray", "success", "successfully", "kadaa", "sure, will do"},
		"arab":       {"congratulations", "daami", "way to go", "hurray", "success", "successfully", "kadaa", "sure, will do"},
		"celebrate":  {"congratulations", "daami", "way to go", "hurray", "success", "successfully", "kadaa", "sure, will do"},
		"graph_ql":   {"graphql", "graphene", "api query"},
		"mongo_db":   {"mongo", "mongodb", "db", "database"},
		"python":     {"python3", "python", "programming"},
		"github":     {"github", "git", "version control", "versioning", "source control"},
		"git":        {"github", "git", "version control", "versioning", "source control"},
		"react1":     {"reactjs", "react"},
		"nodejs":     {"nodejs", "node"},
		"javascript": {"javascript", "programming"},
		"security":   {"secure", "security", "threat", "hacking", "hacker", "hackers", "enterprise security", "threat vector"},
		"youtube":    {"youtube"},
		"linkedin":   {"linkedin"},
		"typescript": {"typescript"},
		"google":     {"google"},
	}
}

Functions

func GetCurrentEmojiNamesOnSlackPost

func GetCurrentEmojiNamesOnSlackPost(GetSlackPostEmojisResponse []slack.ItemReaction) []string

func GetEmojisToReactWith

func GetEmojisToReactWith(text string) (emojis []string)

func GetSlackMessageBlock

func GetSlackMessageBlock(userId string) (SlackMessageBlock []slack.Block)

Types

type Slack

type Slack struct {
	// contains filtered or unexported fields
}

func GetSlackApiClient

func GetSlackApiClient() (slackConfig *Slack, Error error)

func (*Slack) GetCurrentEmojisOnSlackPost

func (s *Slack) GetCurrentEmojisOnSlackPost(msgRef slack.ItemRef) ([]slack.ItemReaction, error)

func (*Slack) PostSlackMessage

func (s *Slack) PostSlackMessage(message string, channel string) error

func (*Slack) ProcessSlackCallbackEvent

func (s *Slack) ProcessSlackCallbackEvent(innerEvent slackevents.EventsAPIInnerEvent) error

func (*Slack) ReactToSlackPost

func (s *Slack) ReactToSlackPost(text string, timestamp string, channel string) error

func (*Slack) WelcomeNewSlackUser

func (s *Slack) WelcomeNewSlackUser(slackUser string, channel string) error

type SlackMessage

type SlackMessage struct {
	Type string     `json:"type"`
	Text *SlackText `json:"text"`
}

func AddUserIdToSlackMessage

func AddUserIdToSlackMessage(userId string, SlackMessage SlackMessage) SlackMessage

func GetRandomMessage

func GetRandomMessage() SlackMessage

func GetSlackMessage

func GetSlackMessage(userId string) SlackMessage

type SlackMessages

type SlackMessages struct {
	Messages []SlackMessage `json:"messages"`
}

func GetSlackMessages

func GetSlackMessages() SlackMessages

type SlackText

type SlackText struct {
	Type string `json:"type"`
	Text string `json:"text"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL