Documentation
¶
Overview ¶
Package pubsub provides Slack event ingestion and reply publishing.
Index ¶
- func NewSlackInput(msg *slackevents.MessageEvent, text string) *cmd.CommandInput
- func NewSlackInputFromAppMention(msg *slackevents.AppMentionEvent, text string) *cmd.CommandInput
- func SlackListener(ctx context.Context, smc *socketmode.Client, ...)
- func SlackWriter(ctx context.Context, smc *socketmode.Client, ...)
- type Config
- type ReplyConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSlackInput ¶
func NewSlackInput(msg *slackevents.MessageEvent, text string) *cmd.CommandInput
NewSlackInput はSlackの入力を元にpubsub.Inputを返す
func NewSlackInputFromAppMention ¶
func NewSlackInputFromAppMention(msg *slackevents.AppMentionEvent, text string) *cmd.CommandInput
NewSlackInputFromAppMention はAppMentionEventを元にpubsub.Inputを返す
func SlackListener ¶
func SlackListener( ctx context.Context, smc *socketmode.Client, commandQueue chan *cmd.CommandInput, cfg Config, )
SlackListener はSocket Modeでメッセージ監視し、コマンドをcommandQueueに投げます。
func SlackWriter ¶
func SlackWriter(ctx context.Context, smc *socketmode.Client, outputQueue chan *cmd.CommandOutput)
SlackWriter はoutputQueueから来たコマンド実行結果をSlackに書き込みます
Types ¶
type Config ¶
type Config struct {
ReplyConfig
SlackBotToken string `toml:"slack_bot_token"`
SlackAppToken string `toml:"slack_app_token"`
AllowUnsafeOpenAccess bool `toml:"allow_unsafe_open_access"`
AcceptReminder bool `toml:"accept_reminder"`
AcceptBotMessage bool `toml:"accept_bot_message"`
AcceptThreadMessage bool `toml:"accept_thread_message"`
AllowedUserIDs []string `toml:"allowed_user_ids"`
AllowedChannelIDs []string `toml:"allowed_channel_ids"`
}
Config defines Slack pub/sub settings.
Click to show internal directories.
Click to hide internal directories.