pubsub

package
v0.0.0-...-460a7fa Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

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(smc *socketmode.Client, commandQueue chan *cmd.CommandInput, cfg Config)

SlackListener はSocket Modeでメッセージ監視し、コマンドをcommandQueueに投げます。

func SlackWriter

func SlackWriter(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"`
	AcceptReminder      bool   `toml:"accept_reminder"`
	AcceptBotMessage    bool   `toml:"accept_bot_message"`
	AcceptThreadMessage bool   `toml:"accept_thread_message"`
}

type ReplyConfig

type ReplyConfig struct {
	Username        string `toml:"username"`
	IconEmoji       string `toml:"icon_emoji"`
	IconURL         string `toml:"icon_url"`
	PostAsReply     bool   `toml:"post_as_reply"`
	AlwaysBroadcast bool   `toml:"always_broadcast"`
	Monospaced      bool
}

Jump to

Keyboard shortcuts

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