Documentation
¶
Index ¶
- func NewDiscordHelper(session *discordgo.Session) shared.Helper
- type DiscordHelper
- func (h *DiscordHelper) ApplicationCommandCreate(appID string, guildID string, cmd *discordgo.ApplicationCommand) (*discordgo.ApplicationCommand, error)
- func (h *DiscordHelper) ApplicationCommandDelete(appID, guildID, cmdID string) error
- func (h *DiscordHelper) ApplicationCommandEdit(appID, guildID, cmdID string, cmd *discordgo.ApplicationCommand) (*discordgo.ApplicationCommand, error)
- func (h *DiscordHelper) ApplicationCommands(appID, guildID string) ([]*discordgo.ApplicationCommand, error)
- func (h *DiscordHelper) Channel(channelID string) (*discordgo.Channel, error)
- func (h *DiscordHelper) ChannelDelete(channelID string) (*discordgo.Channel, error)
- func (h *DiscordHelper) ChannelEdit(channelID string, data *discordgo.ChannelEdit) (*discordgo.Channel, error)
- func (h *DiscordHelper) ChannelMessage(channelID, messageID string) (*discordgo.Message, error)
- func (h *DiscordHelper) ChannelMessageDelete(channelID, messageID string) error
- func (h *DiscordHelper) ChannelMessageEdit(channelID, messageID, content string) (*discordgo.Message, error)
- func (h *DiscordHelper) ChannelMessageEditComplex(m *discordgo.MessageEdit) (*discordgo.Message, error)
- func (h *DiscordHelper) ChannelMessageSend(channelID string, content string) (*discordgo.Message, error)
- func (h *DiscordHelper) ChannelMessageSendComplex(channelID string, data *discordgo.MessageSend) (*discordgo.Message, error)
- func (h *DiscordHelper) ChannelMessageSendEmbed(channelID string, embed *discordgo.MessageEmbed) (*discordgo.Message, error)
- func (h *DiscordHelper) ChannelMessageSendEmbeds(channelID string, embeds []*discordgo.MessageEmbed) (*discordgo.Message, error)
- func (h *DiscordHelper) ChannelMessages(channelID string, limit int, beforeID, afterID, aroundID string) ([]*discordgo.Message, error)
- func (h *DiscordHelper) ChannelTyping(channelID string) error
- func (h *DiscordHelper) Gateway() (string, error)
- func (h *DiscordHelper) GatewayBot() (*discordgo.GatewayBotResponse, error)
- func (h *DiscordHelper) Guild(guildID string) (*discordgo.Guild, error)
- func (h *DiscordHelper) GuildChannels(guildID string) ([]*discordgo.Channel, error)
- func (h *DiscordHelper) GuildMember(guildID, userID string) (*discordgo.Member, error)
- func (h *DiscordHelper) GuildMembers(guildID string, after string, limit int) ([]*discordgo.Member, error)
- func (h *DiscordHelper) GuildRoles(guildID string) ([]*discordgo.Role, error)
- func (h *DiscordHelper) InteractionRespond(interaction *discordgo.Interaction, resp *discordgo.InteractionResponse) error
- func (h *DiscordHelper) InteractionResponseDelete(interaction *discordgo.Interaction) error
- func (h *DiscordHelper) InteractionResponseEdit(interaction *discordgo.Interaction, newresp *discordgo.WebhookEdit) (*discordgo.Message, error)
- func (h *DiscordHelper) MessageReactionAdd(channelID, messageID, emojiID string) error
- func (h *DiscordHelper) MessageReactionRemove(channelID, messageID, emojiID, userID string) error
- func (h *DiscordHelper) MessageReactionsRemoveAll(channelID, messageID string) error
- func (h *DiscordHelper) ThreadJoin(threadID string) error
- func (h *DiscordHelper) ThreadLeave(threadID string) error
- func (h *DiscordHelper) ThreadMemberAdd(threadID, memberID string) error
- func (h *DiscordHelper) ThreadMemberRemove(threadID, memberID string) error
- func (h *DiscordHelper) ThreadStart(channelID, name string, typ discordgo.ChannelType, archiveDuration int) (*discordgo.Channel, error)
- func (h *DiscordHelper) User(userID string) (*discordgo.User, error)
- func (h *DiscordHelper) UserChannelCreate(recipientID string) (*discordgo.Channel, error)
- func (h *DiscordHelper) UserChannelPermissions(userID, channelID string) (int64, error)
- func (h *DiscordHelper) VoiceRegions() ([]*discordgo.VoiceRegion, error)
- func (h *DiscordHelper) WebhookCreate(channelID, name, avatar string) (*discordgo.Webhook, error)
- func (h *DiscordHelper) WebhookExecute(webhookID, token string, wait bool, data *discordgo.WebhookParams) (*discordgo.Message, error)
- type HelperClientImpl
- func (h *HelperClientImpl) ApplicationCommandCreate(appID string, guildID string, cmd *discordgo.ApplicationCommand) (*discordgo.ApplicationCommand, error)
- func (h *HelperClientImpl) ApplicationCommandDelete(appID, guildID, cmdID string) error
- func (h *HelperClientImpl) ApplicationCommandEdit(appID, guildID, cmdID string, cmd *discordgo.ApplicationCommand) (*discordgo.ApplicationCommand, error)
- func (h *HelperClientImpl) ApplicationCommands(appID, guildID string) ([]*discordgo.ApplicationCommand, error)
- func (h *HelperClientImpl) Channel(channelID string) (*discordgo.Channel, error)
- func (h *HelperClientImpl) ChannelDelete(channelID string) (*discordgo.Channel, error)
- func (h *HelperClientImpl) ChannelEdit(channelID string, data *discordgo.ChannelEdit) (*discordgo.Channel, error)
- func (h *HelperClientImpl) ChannelMessage(channelID, messageID string) (*discordgo.Message, error)
- func (h *HelperClientImpl) ChannelMessageDelete(channelID, messageID string) error
- func (h *HelperClientImpl) ChannelMessageEdit(channelID, messageID, content string) (*discordgo.Message, error)
- func (h *HelperClientImpl) ChannelMessageEditComplex(m *discordgo.MessageEdit) (*discordgo.Message, error)
- func (h *HelperClientImpl) ChannelMessageSend(channelID string, content string) (*discordgo.Message, error)
- func (h *HelperClientImpl) ChannelMessageSendComplex(channelID string, data *discordgo.MessageSend) (*discordgo.Message, error)
- func (h *HelperClientImpl) ChannelMessageSendEmbed(channelID string, embed *discordgo.MessageEmbed) (*discordgo.Message, error)
- func (h *HelperClientImpl) ChannelMessageSendEmbeds(channelID string, embeds []*discordgo.MessageEmbed) (*discordgo.Message, error)
- func (h *HelperClientImpl) ChannelMessages(channelID string, limit int, beforeID, afterID, aroundID string) ([]*discordgo.Message, error)
- func (h *HelperClientImpl) ChannelTyping(channelID string) error
- func (h *HelperClientImpl) Gateway() (string, error)
- func (h *HelperClientImpl) GatewayBot() (*discordgo.GatewayBotResponse, error)
- func (h *HelperClientImpl) Guild(guildID string) (*discordgo.Guild, error)
- func (h *HelperClientImpl) GuildChannels(guildID string) ([]*discordgo.Channel, error)
- func (h *HelperClientImpl) GuildMember(guildID, userID string) (*discordgo.Member, error)
- func (h *HelperClientImpl) GuildMembers(guildID string, after string, limit int) ([]*discordgo.Member, error)
- func (h *HelperClientImpl) GuildRoles(guildID string) ([]*discordgo.Role, error)
- func (h *HelperClientImpl) InteractionRespond(interaction *discordgo.Interaction, resp *discordgo.InteractionResponse) error
- func (h *HelperClientImpl) InteractionResponseEdit(interaction *discordgo.Interaction, newresp *discordgo.WebhookEdit) (*discordgo.Message, error)
- func (h *HelperClientImpl) MessageReactionAdd(channelID, messageID, emojiID string) error
- func (h *HelperClientImpl) MessageReactionRemove(channelID, messageID, emojiID, userID string) error
- func (h *HelperClientImpl) MessageReactionsRemoveAll(channelID, messageID string) error
- func (h *HelperClientImpl) ThreadJoin(threadID string) error
- func (h *HelperClientImpl) ThreadLeave(threadID string) error
- func (h *HelperClientImpl) ThreadMemberAdd(threadID, memberID string) error
- func (h *HelperClientImpl) ThreadMemberRemove(threadID, memberID string) error
- func (h *HelperClientImpl) ThreadStart(channelID, name string, typ discordgo.ChannelType, archiveDuration int) (*discordgo.Channel, error)
- func (h *HelperClientImpl) User(userID string) (*discordgo.User, error)
- func (h *HelperClientImpl) UserChannelCreate(recipientID string) (*discordgo.Channel, error)
- func (h *HelperClientImpl) UserChannelPermissions(userID, channelID string) (int64, error)
- func (h *HelperClientImpl) VoiceRegions() ([]*discordgo.VoiceRegion, error)
- func (h *HelperClientImpl) WebhookCreate(channelID, name, avatar string) (*discordgo.Webhook, error)
- func (h *HelperClientImpl) WebhookExecute(webhookID, token string, wait bool, data *discordgo.WebhookParams) (*discordgo.Message, error)
- type HelperServerImpl
- func (h *HelperServerImpl) Channel(ctx context.Context, req *proto.ChannelRequest) (*proto.ChannelResponse, error)
- func (h *HelperServerImpl) ChannelDelete(ctx context.Context, req *proto.ChannelDeleteRequest) (*proto.ChannelDeleteResponse, error)
- func (h *HelperServerImpl) ChannelEdit(ctx context.Context, req *proto.ChannelEditRequest) (*proto.ChannelEditResponse, error)
- func (h *HelperServerImpl) ChannelMessage(ctx context.Context, req *proto.ChannelMessageRequest) (*proto.ChannelMessageResponse, error)
- func (h *HelperServerImpl) ChannelMessageDelete(ctx context.Context, req *proto.ChannelMessageDeleteRequest) (*proto_common.Empty, error)
- func (h *HelperServerImpl) ChannelMessageEdit(ctx context.Context, req *proto.ChannelMessageEditRequest) (*proto.ChannelMessageEditResponse, error)
- func (h *HelperServerImpl) ChannelMessageEditComplex(ctx context.Context, req *proto.ChannelMessageEditComplexRequest) (*proto.ChannelMessageEditComplexResponse, error)
- func (h *HelperServerImpl) ChannelMessageSend(ctx context.Context, req *proto.ChannelMessageSendRequest) (*proto.ChannelMessageSendResponse, error)
- func (h *HelperServerImpl) ChannelMessageSendComplex(ctx context.Context, req *proto.ChannelMessageSendComplexRequest) (*proto.ChannelMessageSendComplexResponse, error)
- func (h *HelperServerImpl) ChannelMessageSendEmbed(ctx context.Context, req *proto.ChannelMessageSendEmbedRequest) (*proto.ChannelMessageSendEmbedResponse, error)
- func (h *HelperServerImpl) ChannelMessageSendEmbeds(ctx context.Context, req *proto.ChannelMessageSendEmbedsRequest) (*proto.ChannelMessageSendEmbedsResponse, error)
- func (h *HelperServerImpl) ChannelMessages(ctx context.Context, req *proto.ChannelMessagesRequest) (*proto.ChannelMessagesResponse, error)
- func (h *HelperServerImpl) ChannelTyping(ctx context.Context, req *proto.ChannelTypingRequest) (*proto_common.Empty, error)
- func (h *HelperServerImpl) Guild(ctx context.Context, req *proto.GuildRequest) (*proto.GuildResponse, error)
- func (h *HelperServerImpl) GuildChannels(ctx context.Context, req *proto.GuildChannelsRequest) (*proto.GuildChannelsResponse, error)
- func (h *HelperServerImpl) GuildMember(ctx context.Context, req *proto.GuildMemberRequest) (*proto.GuildMemberResponse, error)
- func (h *HelperServerImpl) GuildMembers(ctx context.Context, req *proto.GuildMembersRequest) (*proto.GuildMembersResponse, error)
- func (h *HelperServerImpl) GuildRoles(ctx context.Context, req *proto.GuildRolesRequest) (*proto.GuildRolesResponse, error)
- func (h *HelperServerImpl) InteractionRespond(ctx context.Context, req *proto.InteractionRespondRequest) (*proto_common.Empty, error)
- func (h *HelperServerImpl) InteractionResponseEdit(ctx context.Context, req *proto.InteractionResponseEditRequest) (*proto.InteractionResponseEditResponse, error)
- func (h *HelperServerImpl) User(ctx context.Context, req *proto.UserRequest) (*proto.UserResponse, error)
- func (h *HelperServerImpl) UserChannelCreate(ctx context.Context, req *proto.UserChannelCreateRequest) (*proto.UserChannelCreateResponse, error)
- type HookClient
- type ModuleSubscription
- type Plugin
- type QueueScheduler
- type ReceiveBroadcaster
- func (b *ReceiveBroadcaster) GetStats() (packetsReceived uint64, packetsDropped map[string]uint64)
- func (b *ReceiveBroadcaster) GetSubscriberCount() int
- func (b *ReceiveBroadcaster) Start()
- func (b *ReceiveBroadcaster) Stop()
- func (b *ReceiveBroadcaster) Subscribe(moduleID string, recvChan chan *pb.VoicePacket, ...)
- func (b *ReceiveBroadcaster) Unsubscribe(moduleID string)
- type RuntimeClients
- type VoiceHelper
- func (h *VoiceHelper) GetQueueStatus(ctx context.Context, req *pb.QueueStatusRequest) (*pb.QueueStatusResponse, error)
- func (h *VoiceHelper) VoiceJoin(ctx context.Context, req *pb.VoiceJoinRequest) (*pb.VoiceJoinResponse, error)
- func (h *VoiceHelper) VoiceLeave(ctx context.Context, req *pb.VoiceLeaveRequest) (*proto.Empty, error)
- func (h *VoiceHelper) VoiceSpeaking(ctx context.Context, req *pb.VoiceSpeakingRequest) (*proto.Empty, error)
- func (h *VoiceHelper) VoiceStream(stream pb.VoiceStream_VoiceStreamServer) error
- type VoiceReceiver
- type VoiceSession
- type VoiceTask
- type VoiceTaskQueue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DiscordHelper ¶
type DiscordHelper struct {
// contains filtered or unexported fields
}
DiscordHelper implements the Helper interface using an actual Discord session
func (*DiscordHelper) ApplicationCommandCreate ¶
func (h *DiscordHelper) ApplicationCommandCreate(appID string, guildID string, cmd *discordgo.ApplicationCommand) (*discordgo.ApplicationCommand, error)
func (*DiscordHelper) ApplicationCommandDelete ¶
func (h *DiscordHelper) ApplicationCommandDelete(appID, guildID, cmdID string) error
func (*DiscordHelper) ApplicationCommandEdit ¶
func (h *DiscordHelper) ApplicationCommandEdit(appID, guildID, cmdID string, cmd *discordgo.ApplicationCommand) (*discordgo.ApplicationCommand, error)
func (*DiscordHelper) ApplicationCommands ¶
func (h *DiscordHelper) ApplicationCommands(appID, guildID string) ([]*discordgo.ApplicationCommand, error)
func (*DiscordHelper) Channel ¶
func (h *DiscordHelper) Channel(channelID string) (*discordgo.Channel, error)
func (*DiscordHelper) ChannelDelete ¶
func (h *DiscordHelper) ChannelDelete(channelID string) (*discordgo.Channel, error)
func (*DiscordHelper) ChannelEdit ¶
func (h *DiscordHelper) ChannelEdit(channelID string, data *discordgo.ChannelEdit) (*discordgo.Channel, error)
func (*DiscordHelper) ChannelMessage ¶
func (h *DiscordHelper) ChannelMessage(channelID, messageID string) (*discordgo.Message, error)
func (*DiscordHelper) ChannelMessageDelete ¶
func (h *DiscordHelper) ChannelMessageDelete(channelID, messageID string) error
func (*DiscordHelper) ChannelMessageEdit ¶
func (h *DiscordHelper) ChannelMessageEdit(channelID, messageID, content string) (*discordgo.Message, error)
func (*DiscordHelper) ChannelMessageEditComplex ¶
func (h *DiscordHelper) ChannelMessageEditComplex(m *discordgo.MessageEdit) (*discordgo.Message, error)
func (*DiscordHelper) ChannelMessageSend ¶
func (*DiscordHelper) ChannelMessageSendComplex ¶
func (h *DiscordHelper) ChannelMessageSendComplex(channelID string, data *discordgo.MessageSend) (*discordgo.Message, error)
func (*DiscordHelper) ChannelMessageSendEmbed ¶
func (h *DiscordHelper) ChannelMessageSendEmbed(channelID string, embed *discordgo.MessageEmbed) (*discordgo.Message, error)
func (*DiscordHelper) ChannelMessageSendEmbeds ¶
func (h *DiscordHelper) ChannelMessageSendEmbeds(channelID string, embeds []*discordgo.MessageEmbed) (*discordgo.Message, error)
func (*DiscordHelper) ChannelMessages ¶
func (*DiscordHelper) ChannelTyping ¶
func (h *DiscordHelper) ChannelTyping(channelID string) error
func (*DiscordHelper) Gateway ¶
func (h *DiscordHelper) Gateway() (string, error)
func (*DiscordHelper) GatewayBot ¶
func (h *DiscordHelper) GatewayBot() (*discordgo.GatewayBotResponse, error)
func (*DiscordHelper) Guild ¶
func (h *DiscordHelper) Guild(guildID string) (*discordgo.Guild, error)
func (*DiscordHelper) GuildChannels ¶
func (h *DiscordHelper) GuildChannels(guildID string) ([]*discordgo.Channel, error)
func (*DiscordHelper) GuildMember ¶
func (h *DiscordHelper) GuildMember(guildID, userID string) (*discordgo.Member, error)
func (*DiscordHelper) GuildMembers ¶
func (*DiscordHelper) GuildRoles ¶
func (h *DiscordHelper) GuildRoles(guildID string) ([]*discordgo.Role, error)
func (*DiscordHelper) InteractionRespond ¶
func (h *DiscordHelper) InteractionRespond(interaction *discordgo.Interaction, resp *discordgo.InteractionResponse) error
func (*DiscordHelper) InteractionResponseDelete ¶
func (h *DiscordHelper) InteractionResponseDelete(interaction *discordgo.Interaction) error
func (*DiscordHelper) InteractionResponseEdit ¶
func (h *DiscordHelper) InteractionResponseEdit(interaction *discordgo.Interaction, newresp *discordgo.WebhookEdit) (*discordgo.Message, error)
func (*DiscordHelper) MessageReactionAdd ¶
func (h *DiscordHelper) MessageReactionAdd(channelID, messageID, emojiID string) error
func (*DiscordHelper) MessageReactionRemove ¶
func (h *DiscordHelper) MessageReactionRemove(channelID, messageID, emojiID, userID string) error
func (*DiscordHelper) MessageReactionsRemoveAll ¶
func (h *DiscordHelper) MessageReactionsRemoveAll(channelID, messageID string) error
func (*DiscordHelper) ThreadJoin ¶
func (h *DiscordHelper) ThreadJoin(threadID string) error
func (*DiscordHelper) ThreadLeave ¶
func (h *DiscordHelper) ThreadLeave(threadID string) error
func (*DiscordHelper) ThreadMemberAdd ¶
func (h *DiscordHelper) ThreadMemberAdd(threadID, memberID string) error
func (*DiscordHelper) ThreadMemberRemove ¶
func (h *DiscordHelper) ThreadMemberRemove(threadID, memberID string) error
func (*DiscordHelper) ThreadStart ¶
func (h *DiscordHelper) ThreadStart(channelID, name string, typ discordgo.ChannelType, archiveDuration int) (*discordgo.Channel, error)
func (*DiscordHelper) UserChannelCreate ¶
func (h *DiscordHelper) UserChannelCreate(recipientID string) (*discordgo.Channel, error)
func (*DiscordHelper) UserChannelPermissions ¶
func (h *DiscordHelper) UserChannelPermissions(userID, channelID string) (int64, error)
func (*DiscordHelper) VoiceRegions ¶
func (h *DiscordHelper) VoiceRegions() ([]*discordgo.VoiceRegion, error)
func (*DiscordHelper) WebhookCreate ¶
func (h *DiscordHelper) WebhookCreate(channelID, name, avatar string) (*discordgo.Webhook, error)
func (*DiscordHelper) WebhookExecute ¶
func (h *DiscordHelper) WebhookExecute(webhookID, token string, wait bool, data *discordgo.WebhookParams) (*discordgo.Message, error)
type HelperClientImpl ¶
type HelperClientImpl struct {
// contains filtered or unexported fields
}
HelperClientImpl implements the Helper interface for runtime-side operations. This is usually not needed since runtime provides helpers, but included for completeness.
func (*HelperClientImpl) ApplicationCommandCreate ¶
func (h *HelperClientImpl) ApplicationCommandCreate(appID string, guildID string, cmd *discordgo.ApplicationCommand) (*discordgo.ApplicationCommand, error)
func (*HelperClientImpl) ApplicationCommandDelete ¶
func (h *HelperClientImpl) ApplicationCommandDelete(appID, guildID, cmdID string) error
func (*HelperClientImpl) ApplicationCommandEdit ¶
func (h *HelperClientImpl) ApplicationCommandEdit(appID, guildID, cmdID string, cmd *discordgo.ApplicationCommand) (*discordgo.ApplicationCommand, error)
func (*HelperClientImpl) ApplicationCommands ¶
func (h *HelperClientImpl) ApplicationCommands(appID, guildID string) ([]*discordgo.ApplicationCommand, error)
func (*HelperClientImpl) Channel ¶
func (h *HelperClientImpl) Channel(channelID string) (*discordgo.Channel, error)
func (*HelperClientImpl) ChannelDelete ¶
func (h *HelperClientImpl) ChannelDelete(channelID string) (*discordgo.Channel, error)
func (*HelperClientImpl) ChannelEdit ¶
func (h *HelperClientImpl) ChannelEdit(channelID string, data *discordgo.ChannelEdit) (*discordgo.Channel, error)
func (*HelperClientImpl) ChannelMessage ¶
func (h *HelperClientImpl) ChannelMessage(channelID, messageID string) (*discordgo.Message, error)
func (*HelperClientImpl) ChannelMessageDelete ¶
func (h *HelperClientImpl) ChannelMessageDelete(channelID, messageID string) error
func (*HelperClientImpl) ChannelMessageEdit ¶
func (h *HelperClientImpl) ChannelMessageEdit(channelID, messageID, content string) (*discordgo.Message, error)
func (*HelperClientImpl) ChannelMessageEditComplex ¶
func (h *HelperClientImpl) ChannelMessageEditComplex(m *discordgo.MessageEdit) (*discordgo.Message, error)
func (*HelperClientImpl) ChannelMessageSend ¶
func (h *HelperClientImpl) ChannelMessageSend(channelID string, content string) (*discordgo.Message, error)
Minimal implementation for interface compliance - just enough to satisfy shared.Helper interface
func (*HelperClientImpl) ChannelMessageSendComplex ¶
func (h *HelperClientImpl) ChannelMessageSendComplex(channelID string, data *discordgo.MessageSend) (*discordgo.Message, error)
func (*HelperClientImpl) ChannelMessageSendEmbed ¶
func (h *HelperClientImpl) ChannelMessageSendEmbed(channelID string, embed *discordgo.MessageEmbed) (*discordgo.Message, error)
func (*HelperClientImpl) ChannelMessageSendEmbeds ¶
func (h *HelperClientImpl) ChannelMessageSendEmbeds(channelID string, embeds []*discordgo.MessageEmbed) (*discordgo.Message, error)
func (*HelperClientImpl) ChannelMessages ¶
func (*HelperClientImpl) ChannelTyping ¶
func (h *HelperClientImpl) ChannelTyping(channelID string) error
func (*HelperClientImpl) Gateway ¶
func (h *HelperClientImpl) Gateway() (string, error)
func (*HelperClientImpl) GatewayBot ¶
func (h *HelperClientImpl) GatewayBot() (*discordgo.GatewayBotResponse, error)
func (*HelperClientImpl) Guild ¶
func (h *HelperClientImpl) Guild(guildID string) (*discordgo.Guild, error)
func (*HelperClientImpl) GuildChannels ¶
func (h *HelperClientImpl) GuildChannels(guildID string) ([]*discordgo.Channel, error)
func (*HelperClientImpl) GuildMember ¶
func (h *HelperClientImpl) GuildMember(guildID, userID string) (*discordgo.Member, error)
func (*HelperClientImpl) GuildMembers ¶
func (*HelperClientImpl) GuildRoles ¶
func (h *HelperClientImpl) GuildRoles(guildID string) ([]*discordgo.Role, error)
func (*HelperClientImpl) InteractionRespond ¶
func (h *HelperClientImpl) InteractionRespond(interaction *discordgo.Interaction, resp *discordgo.InteractionResponse) error
func (*HelperClientImpl) InteractionResponseEdit ¶
func (h *HelperClientImpl) InteractionResponseEdit(interaction *discordgo.Interaction, newresp *discordgo.WebhookEdit) (*discordgo.Message, error)
func (*HelperClientImpl) MessageReactionAdd ¶
func (h *HelperClientImpl) MessageReactionAdd(channelID, messageID, emojiID string) error
func (*HelperClientImpl) MessageReactionRemove ¶
func (h *HelperClientImpl) MessageReactionRemove(channelID, messageID, emojiID, userID string) error
func (*HelperClientImpl) MessageReactionsRemoveAll ¶
func (h *HelperClientImpl) MessageReactionsRemoveAll(channelID, messageID string) error
func (*HelperClientImpl) ThreadJoin ¶
func (h *HelperClientImpl) ThreadJoin(threadID string) error
func (*HelperClientImpl) ThreadLeave ¶
func (h *HelperClientImpl) ThreadLeave(threadID string) error
func (*HelperClientImpl) ThreadMemberAdd ¶
func (h *HelperClientImpl) ThreadMemberAdd(threadID, memberID string) error
func (*HelperClientImpl) ThreadMemberRemove ¶
func (h *HelperClientImpl) ThreadMemberRemove(threadID, memberID string) error
func (*HelperClientImpl) ThreadStart ¶
func (h *HelperClientImpl) ThreadStart(channelID, name string, typ discordgo.ChannelType, archiveDuration int) (*discordgo.Channel, error)
func (*HelperClientImpl) User ¶
func (h *HelperClientImpl) User(userID string) (*discordgo.User, error)
func (*HelperClientImpl) UserChannelCreate ¶
func (h *HelperClientImpl) UserChannelCreate(recipientID string) (*discordgo.Channel, error)
func (*HelperClientImpl) UserChannelPermissions ¶
func (h *HelperClientImpl) UserChannelPermissions(userID, channelID string) (int64, error)
func (*HelperClientImpl) VoiceRegions ¶
func (h *HelperClientImpl) VoiceRegions() ([]*discordgo.VoiceRegion, error)
func (*HelperClientImpl) WebhookCreate ¶
func (h *HelperClientImpl) WebhookCreate(channelID, name, avatar string) (*discordgo.Webhook, error)
func (*HelperClientImpl) WebhookExecute ¶
func (h *HelperClientImpl) WebhookExecute(webhookID, token string, wait bool, data *discordgo.WebhookParams) (*discordgo.Message, error)
type HelperServerImpl ¶
type HelperServerImpl struct {
proto.UnimplementedHelperServer
Impl shared.Helper // Helper implementation that provides Discord operations
// contains filtered or unexported fields
}
HelperServerImpl implements the Helper gRPC server for the runtime-side. This server receives calls from the module and provides actual Discord operations.
func (*HelperServerImpl) Channel ¶
func (h *HelperServerImpl) Channel(ctx context.Context, req *proto.ChannelRequest) (*proto.ChannelResponse, error)
Channel handles getting a channel by ID.
func (*HelperServerImpl) ChannelDelete ¶
func (h *HelperServerImpl) ChannelDelete(ctx context.Context, req *proto.ChannelDeleteRequest) (*proto.ChannelDeleteResponse, error)
ChannelDelete handles deleting a channel.
func (*HelperServerImpl) ChannelEdit ¶
func (h *HelperServerImpl) ChannelEdit(ctx context.Context, req *proto.ChannelEditRequest) (*proto.ChannelEditResponse, error)
ChannelEdit handles editing a channel.
func (*HelperServerImpl) ChannelMessage ¶
func (h *HelperServerImpl) ChannelMessage(ctx context.Context, req *proto.ChannelMessageRequest) (*proto.ChannelMessageResponse, error)
ChannelMessage handles retrieving a single message from a channel.
func (*HelperServerImpl) ChannelMessageDelete ¶
func (h *HelperServerImpl) ChannelMessageDelete(ctx context.Context, req *proto.ChannelMessageDeleteRequest) (*proto_common.Empty, error)
ChannelMessageDelete handles deleting a message from a channel.
func (*HelperServerImpl) ChannelMessageEdit ¶
func (h *HelperServerImpl) ChannelMessageEdit(ctx context.Context, req *proto.ChannelMessageEditRequest) (*proto.ChannelMessageEditResponse, error)
ChannelMessageEdit handles editing a message with simple text content.
func (*HelperServerImpl) ChannelMessageEditComplex ¶
func (h *HelperServerImpl) ChannelMessageEditComplex(ctx context.Context, req *proto.ChannelMessageEditComplexRequest) (*proto.ChannelMessageEditComplexResponse, error)
ChannelMessageEditComplex handles editing a message with complex data.
func (*HelperServerImpl) ChannelMessageSend ¶
func (h *HelperServerImpl) ChannelMessageSend(ctx context.Context, req *proto.ChannelMessageSendRequest) (*proto.ChannelMessageSendResponse, error)
ChannelMessageSend handles sending a simple text message.
func (*HelperServerImpl) ChannelMessageSendComplex ¶
func (h *HelperServerImpl) ChannelMessageSendComplex(ctx context.Context, req *proto.ChannelMessageSendComplexRequest) (*proto.ChannelMessageSendComplexResponse, error)
ChannelMessageSendComplex handles sending a complex message with attachments, embeds, etc.
func (*HelperServerImpl) ChannelMessageSendEmbed ¶
func (h *HelperServerImpl) ChannelMessageSendEmbed(ctx context.Context, req *proto.ChannelMessageSendEmbedRequest) (*proto.ChannelMessageSendEmbedResponse, error)
ChannelMessageSendEmbed handles sending a message with a single embed.
func (*HelperServerImpl) ChannelMessageSendEmbeds ¶
func (h *HelperServerImpl) ChannelMessageSendEmbeds(ctx context.Context, req *proto.ChannelMessageSendEmbedsRequest) (*proto.ChannelMessageSendEmbedsResponse, error)
ChannelMessageSendEmbeds handles sending a message with multiple embeds.
func (*HelperServerImpl) ChannelMessages ¶
func (h *HelperServerImpl) ChannelMessages(ctx context.Context, req *proto.ChannelMessagesRequest) (*proto.ChannelMessagesResponse, error)
ChannelMessages handles retrieving multiple messages from a channel.
func (*HelperServerImpl) ChannelTyping ¶
func (h *HelperServerImpl) ChannelTyping(ctx context.Context, req *proto.ChannelTypingRequest) (*proto_common.Empty, error)
ChannelTyping handles sending typing indicator.
func (*HelperServerImpl) Guild ¶
func (h *HelperServerImpl) Guild(ctx context.Context, req *proto.GuildRequest) (*proto.GuildResponse, error)
Guild handles getting a guild by ID.
func (*HelperServerImpl) GuildChannels ¶
func (h *HelperServerImpl) GuildChannels(ctx context.Context, req *proto.GuildChannelsRequest) (*proto.GuildChannelsResponse, error)
GuildChannels handles getting channels in a guild.
func (*HelperServerImpl) GuildMember ¶
func (h *HelperServerImpl) GuildMember(ctx context.Context, req *proto.GuildMemberRequest) (*proto.GuildMemberResponse, error)
GuildMember handles getting a specific member in a guild.
func (*HelperServerImpl) GuildMembers ¶
func (h *HelperServerImpl) GuildMembers(ctx context.Context, req *proto.GuildMembersRequest) (*proto.GuildMembersResponse, error)
GuildMembers handles getting members in a guild.
func (*HelperServerImpl) GuildRoles ¶
func (h *HelperServerImpl) GuildRoles(ctx context.Context, req *proto.GuildRolesRequest) (*proto.GuildRolesResponse, error)
GuildRoles handles getting roles in a guild.
func (*HelperServerImpl) InteractionRespond ¶
func (h *HelperServerImpl) InteractionRespond(ctx context.Context, req *proto.InteractionRespondRequest) (*proto_common.Empty, error)
InteractionRespond handles responding to an interaction.
func (*HelperServerImpl) InteractionResponseEdit ¶
func (h *HelperServerImpl) InteractionResponseEdit(ctx context.Context, req *proto.InteractionResponseEditRequest) (*proto.InteractionResponseEditResponse, error)
InteractionResponseEdit handles editing an interaction response.
func (*HelperServerImpl) User ¶
func (h *HelperServerImpl) User(ctx context.Context, req *proto.UserRequest) (*proto.UserResponse, error)
User handles getting a user by ID.
func (*HelperServerImpl) UserChannelCreate ¶
func (h *HelperServerImpl) UserChannelCreate(ctx context.Context, req *proto.UserChannelCreateRequest) (*proto.UserChannelCreateResponse, error)
UserChannelCreate handles creating a DM channel with a user.
type HookClient ¶
type HookClient struct {
// contains filtered or unexported fields
}
`runtime/client.go` implements the gRPC client for making calls to the module.
This part works on the runtime-side and is the gRPC client implementation for the module.
func (*HookClient) OnCreateChatMessage ¶
func (m *HookClient) OnCreateChatMessage(message *discordgo.Message) error
OnCreateChatMessage sends a message to the plugin via RPC.
func (*HookClient) OnCreateInteraction ¶
func (m *HookClient) OnCreateInteraction(interaction *discordgo.Interaction) error
OnCreateInteraction sends an interaction to the plugin via RPC.
func (*HookClient) OnEvent ¶
func (m *HookClient) OnEvent(event string) error
OnEvent sends an event to the plugin via RPC.
func (*HookClient) OnInit ¶
func (m *HookClient) OnInit(helper shared.Helper) shared.InitResponse
OnInit calls the OnInit RPC method and returns the initialization response.
type ModuleSubscription ¶
type ModuleSubscription struct {
ModuleID string
ConnectionID string
SubmitChan chan *VoiceTask
RecvChan chan *pb.VoicePacket
Stream pb.VoiceStream_VoiceStreamServer
CreatedAt time.Time
LastActivity time.Time
// contains filtered or unexported fields
}
ModuleSubscription represents a module's subscription to a voice session
type Plugin ¶
type Plugin struct {
plugin.NetRPCUnsupportedPlugin
Helper shared.Helper // The implementation of the Helper interface (runtime side)
Hook shared.Hook // Hook client to call module's hook functions
VoiceHelper *VoiceHelper // Voice streaming helper
}
FlexModule uses hashicorp/go-plugin: So we need to declare a separate Plugin for the runtime and module.
`runtime/server.go` implements the gRPC server for receiving from the module.
`runtime/client.go` implements the gRPC client for making calls to the module.
func (*Plugin) GRPCClient ¶
func (p *Plugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)
func (*Plugin) GRPCServer ¶
type QueueScheduler ¶
type QueueScheduler struct {
// contains filtered or unexported fields
}
QueueScheduler processes tasks from the queue and sends to VoiceConnection
func NewQueueScheduler ¶
func NewQueueScheduler(queue *VoiceTaskQueue, vc *discordgo.VoiceConnection, ctx context.Context, log hclog.Logger) *QueueScheduler
NewQueueScheduler creates a new queue scheduler
func (*QueueScheduler) GetStats ¶
func (s *QueueScheduler) GetStats() (tasksProcessed, bytesSent map[string]uint64)
GetStats returns scheduler statistics
func (*QueueScheduler) Start ¶
func (s *QueueScheduler) Start()
Start begins processing tasks from the queue
type ReceiveBroadcaster ¶
type ReceiveBroadcaster struct {
// contains filtered or unexported fields
}
ReceiveBroadcaster broadcasts received voice packets to all subscribers
func NewReceiveBroadcaster ¶
func NewReceiveBroadcaster(vc *discordgo.VoiceConnection, ctx context.Context, log hclog.Logger) *ReceiveBroadcaster
NewReceiveBroadcaster creates a new receive broadcaster
func (*ReceiveBroadcaster) GetStats ¶
func (b *ReceiveBroadcaster) GetStats() (packetsReceived uint64, packetsDropped map[string]uint64)
GetStats returns broadcaster statistics
func (*ReceiveBroadcaster) GetSubscriberCount ¶
func (b *ReceiveBroadcaster) GetSubscriberCount() int
GetSubscriberCount returns the number of active subscribers
func (*ReceiveBroadcaster) Start ¶
func (b *ReceiveBroadcaster) Start()
Start begins broadcasting received voice packets
func (*ReceiveBroadcaster) Subscribe ¶
func (b *ReceiveBroadcaster) Subscribe(moduleID string, recvChan chan *pb.VoicePacket, filter func(*discordgo.Packet) bool)
Subscribe adds a new receiver
func (*ReceiveBroadcaster) Unsubscribe ¶
func (b *ReceiveBroadcaster) Unsubscribe(moduleID string)
Unsubscribe removes a receiver
type RuntimeClients ¶
type RuntimeClients struct {
Hook shared.Hook
Helper shared.Helper
VoiceStream proto.VoiceStreamClient
}
RuntimeClients wraps both Hook and Helper clients for runtime
func (*RuntimeClients) GetHelper ¶
func (r *RuntimeClients) GetHelper() shared.Helper
GetHelper returns the Helper client
func (*RuntimeClients) GetHook ¶
func (r *RuntimeClients) GetHook() shared.Hook
GetHook returns the Hook client
func (*RuntimeClients) GetVoiceStream ¶
func (r *RuntimeClients) GetVoiceStream() proto.VoiceStreamClient
GetVoiceStream returns the VoiceStream client
type VoiceHelper ¶
type VoiceHelper struct {
pb.UnimplementedVoiceStreamServer
// contains filtered or unexported fields
}
VoiceHelper implements the VoiceStream gRPC service
func NewVoiceHelper ¶
func NewVoiceHelper(session *discordgo.Session, log hclog.Logger) *VoiceHelper
NewVoiceHelper creates a new voice helper
func (*VoiceHelper) GetQueueStatus ¶
func (h *VoiceHelper) GetQueueStatus(ctx context.Context, req *pb.QueueStatusRequest) (*pb.QueueStatusResponse, error)
GetQueueStatus implements VoiceStream.GetQueueStatus
func (*VoiceHelper) VoiceJoin ¶
func (h *VoiceHelper) VoiceJoin(ctx context.Context, req *pb.VoiceJoinRequest) (*pb.VoiceJoinResponse, error)
VoiceJoin implements VoiceStream.VoiceJoin
func (*VoiceHelper) VoiceLeave ¶
func (h *VoiceHelper) VoiceLeave(ctx context.Context, req *pb.VoiceLeaveRequest) (*proto.Empty, error)
VoiceLeave implements VoiceStream.VoiceLeave
func (*VoiceHelper) VoiceSpeaking ¶
func (h *VoiceHelper) VoiceSpeaking(ctx context.Context, req *pb.VoiceSpeakingRequest) (*proto.Empty, error)
VoiceSpeaking implements VoiceStream.VoiceSpeaking
func (*VoiceHelper) VoiceStream ¶
func (h *VoiceHelper) VoiceStream(stream pb.VoiceStream_VoiceStreamServer) error
VoiceStream implements VoiceStream.VoiceStream
type VoiceReceiver ¶
type VoiceReceiver struct {
ModuleID string
RecvChan chan *pb.VoicePacket
Filter func(*discordgo.Packet) bool // Optional filter
}
VoiceReceiver represents a module subscribed to receive voice data
type VoiceSession ¶
type VoiceSession struct {
GuildID string
ChannelID string
// contains filtered or unexported fields
}
VoiceSession represents a voice session for a guild
type VoiceTask ¶
type VoiceTask struct {
TaskID string
ModuleID string
OpusData []byte
Priority int
SubmitTime time.Time
Timeout time.Duration
}
VoiceTask represents a voice task in the queue
type VoiceTaskQueue ¶
type VoiceTaskQueue struct {
// contains filtered or unexported fields
}
VoiceTaskQueue manages voice tasks with priority support
func NewVoiceTaskQueue ¶
func NewVoiceTaskQueue() *VoiceTaskQueue
NewVoiceTaskQueue creates a new voice task queue
func (*VoiceTaskQueue) CleanExpired ¶
func (q *VoiceTaskQueue) CleanExpired() int
CleanExpired removes expired tasks
func (*VoiceTaskQueue) Dequeue ¶
func (q *VoiceTaskQueue) Dequeue() (*VoiceTask, error)
Dequeue removes and returns the next task (blocking)
func (*VoiceTaskQueue) Enqueue ¶
func (q *VoiceTaskQueue) Enqueue(task *VoiceTask) error
Enqueue adds a task to the queue
func (*VoiceTaskQueue) Length ¶
func (q *VoiceTaskQueue) Length() int
Length returns the current queue length
func (*VoiceTaskQueue) Stats ¶
func (q *VoiceTaskQueue) Stats() (enqueued, dequeued, expired uint64)
Stats returns queue statistics