Documentation ¶
Index ¶
- type AllowedMentions
- type Discord
- type DiscordCommand
- type DiscordHandler
- func (d *DiscordHandler) AnswerDiscordMessage(msg string, originalMessage *discordgo.Message) (*discordgo.Message, error)
- func (d *DiscordHandler) Close()
- func (d *DiscordHandler) DiscordMessagesSent(ctx context.Context) (<-chan discordgo.Message, error)
- func (d *DiscordHandler) RegisterCommands() error
- func (d *DiscordHandler) SearchDiscordUser(username string) (*discordgo.Member, error)
- func (d *DiscordHandler) SendMessage(ctx context.Context, msg *discord.Message) error
- func (d *DiscordHandler) SendMessageToIngameChat(ctx context.Context, message *mongo.ChatMessage) error
- func (d *DiscordHandler) UpdateDiscordGuildUsers()
- type MuteCommand
- type UnmuteCommand
- type WebhookRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllowedMentions ¶
type AllowedMentions struct {
Parse []string `json:"parse"`
}
type DiscordCommand ¶
type DiscordCommand interface { Name() string CreateCommand() *discordgo.ApplicationCommand HandleCommand(s *discordgo.Session, i *discordgo.InteractionCreate) }
type DiscordHandler ¶
type DiscordHandler struct {
// contains filtered or unexported fields
}
func InitSession ¶
func InitSession(mute *MuteCommand, unmute *UnmuteCommand) (DiscordHandler, error)
func NewDiscordHandler ¶
func NewDiscordHandler(mute *MuteCommand, unmute *UnmuteCommand) *DiscordHandler
func (*DiscordHandler) AnswerDiscordMessage ¶
func (*DiscordHandler) Close ¶
func (d *DiscordHandler) Close()
func (*DiscordHandler) DiscordMessagesSent ¶
DiscordMessagesSent returns a channel which contains all messages received from discord, or error if such a channel already exists
func (*DiscordHandler) RegisterCommands ¶
func (d *DiscordHandler) RegisterCommands() error
func (*DiscordHandler) SearchDiscordUser ¶
func (d *DiscordHandler) SearchDiscordUser(username string) (*discordgo.Member, error)
func (*DiscordHandler) SendMessage ¶
SendMessage sends a discord message to the discord server
func (*DiscordHandler) SendMessageToIngameChat ¶
func (d *DiscordHandler) SendMessageToIngameChat(ctx context.Context, message *mongo.ChatMessage) error
func (*DiscordHandler) UpdateDiscordGuildUsers ¶
func (d *DiscordHandler) UpdateDiscordGuildUsers()
type MuteCommand ¶
type MuteCommand struct {
// contains filtered or unexported fields
}
func NewMuteCommand ¶
func NewMuteCommand(chat *coflnet.ChatApi, api *coflnet.ApiClient) *MuteCommand
func (*MuteCommand) CreateCommand ¶
func (m *MuteCommand) CreateCommand() *discordgo.ApplicationCommand
func (*MuteCommand) HandleCommand ¶
func (m *MuteCommand) HandleCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
func (*MuteCommand) Name ¶
func (m *MuteCommand) Name() string
type UnmuteCommand ¶
type UnmuteCommand struct {
// contains filtered or unexported fields
}
func NewUnmuteCommand ¶
func NewUnmuteCommand(chat *coflnet.ChatApi, api *coflnet.ApiClient) *UnmuteCommand
func (*UnmuteCommand) CreateCommand ¶
func (m *UnmuteCommand) CreateCommand() *discordgo.ApplicationCommand
func (*UnmuteCommand) HandleCommand ¶
func (m *UnmuteCommand) HandleCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
func (*UnmuteCommand) Name ¶
func (m *UnmuteCommand) Name() string
type WebhookRequest ¶
type WebhookRequest struct { Content string `json:"content"` Username string `json:"username"` AvatarUrl string `json:"avatar_url"` AllowedMentionsData AllowedMentions `json:"allowed_mentions"` }
Click to show internal directories.
Click to hide internal directories.