discord

package
v0.0.0-...-b986d7c Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

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 Discord

type Discord interface {
	SendMessage(msg *discord.Message) error
}

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 (d *DiscordHandler) AnswerDiscordMessage(msg string, originalMessage *discordgo.Message) (*discordgo.Message, error)

func (*DiscordHandler) Close

func (d *DiscordHandler) Close()

func (*DiscordHandler) DiscordMessagesSent

func (d *DiscordHandler) DiscordMessagesSent(ctx context.Context) (<-chan discordgo.Message, error)

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

func (d *DiscordHandler) SendMessage(ctx context.Context, msg *discord.Message) error

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"`
}

Jump to

Keyboard shortcuts

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