Documentation ¶
Index ¶
- func AttachGuild(ctx context.Context, req *bot.AttachGuildRequest) error
- func DetachGuild(ctx context.Context, req *bot.DetachGuildRequest) error
- func DisableCommand(ctx context.Context, req *bot.DisableCommandRequest, svc *Service) error
- func EnableCommand(ctx context.Context, req *bot.EnableCommandRequest, svc *Service) error
- func ExecuteCommand(ctx context.Context, req *bot.CommandExecutionRequest, svc *Service) (*bot.CommandExecutionResult, error)
- func ListAttachedGuilds(ctx context.Context) (*bot.ListAttachedGuildsResponse, error)
- func ListExistingCommands() (*bot.ListExistingCommandsResponse, error)
- func ListGuildCommands(ctx context.Context, req *bot.ListGuildCommandsRequest, svc *Service) (*bot.ListGuildCommandsResponse, error)
- func ListGuildEventHandlers(ctx context.Context, req *bot.ListGuildEventHandlersRequest) (*bot.ListGuildEventHandlersResponse, error)
- func RegisterEventHandler(ctx context.Context, req *bot.RegisterEventHandlerRequest) error
- func UnregisterEventHandler(ctx context.Context, req *bot.UnregisterEventHandlerRequest) error
- type Service
- func (svc *Service) AttachGuild(ctx context.Context, req *bot.AttachGuildRequest) (*emptypb.Empty, error)
- func (svc *Service) DetachGuild(ctx context.Context, req *bot.DetachGuildRequest) (*emptypb.Empty, error)
- func (svc *Service) DisableCommand(ctx context.Context, req *bot.DisableCommandRequest) (*emptypb.Empty, error)
- func (svc *Service) EnableCommand(ctx context.Context, req *bot.EnableCommandRequest) (*emptypb.Empty, error)
- func (svc *Service) ExecuteCommand(ctx context.Context, req *bot.CommandExecutionRequest) (*bot.CommandExecutionResult, error)
- func (svc *Service) ListAttachedGuilds(ctx context.Context, _ *emptypb.Empty) (*bot.ListAttachedGuildsResponse, error)
- func (svc *Service) ListExistingCommands(ctx context.Context, _ *emptypb.Empty) (*bot.ListExistingCommandsResponse, error)
- func (svc *Service) ListGuildCommands(ctx context.Context, req *bot.ListGuildCommandsRequest) (*bot.ListGuildCommandsResponse, error)
- func (svc *Service) ListGuildEventHandlers(ctx context.Context, req *bot.ListGuildEventHandlersRequest) (*bot.ListGuildEventHandlersResponse, error)
- func (svc *Service) RegisterEventHandler(ctx context.Context, req *bot.RegisterEventHandlerRequest) (*emptypb.Empty, error)
- func (svc *Service) UnregisterEventHandler(ctx context.Context, req *bot.UnregisterEventHandlerRequest) (*emptypb.Empty, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AttachGuild ¶
func AttachGuild(ctx context.Context, req *bot.AttachGuildRequest) error
AttachGuild is the implementation of the AttachGuild RPC
func DetachGuild ¶
func DetachGuild(ctx context.Context, req *bot.DetachGuildRequest) error
DetachGuild is the implementation of the DetachGuild RPC
func DisableCommand ¶
DisableCommand is the implementation of the DisableCommand RPC
func EnableCommand ¶
EnableCommand is the implementation of the EnableCommand RPC
func ExecuteCommand ¶
func ExecuteCommand(ctx context.Context, req *bot.CommandExecutionRequest, svc *Service) (*bot.CommandExecutionResult, error)
ExecuteCommand is the implementation of the ExecuteCommand RPC
func ListAttachedGuilds ¶
func ListAttachedGuilds(ctx context.Context) (*bot.ListAttachedGuildsResponse, error)
ListAttachedGuilds is the implementation of the ListAttachedGuilds RPC
func ListExistingCommands ¶
func ListExistingCommands() (*bot.ListExistingCommandsResponse, error)
ListExistingCommands is the implementation of the ListExistingCommands RPC
func ListGuildCommands ¶
func ListGuildCommands(ctx context.Context, req *bot.ListGuildCommandsRequest, svc *Service) (*bot.ListGuildCommandsResponse, error)
ListGuildCommands is the implementation of the ListGuildCommands RPC
func ListGuildEventHandlers ¶
func ListGuildEventHandlers(ctx context.Context, req *bot.ListGuildEventHandlersRequest) (*bot.ListGuildEventHandlersResponse, error)
ListGuildEventHandlers is the implementation of the ListGuildEventHandlers RPC
func RegisterEventHandler ¶
func RegisterEventHandler(ctx context.Context, req *bot.RegisterEventHandlerRequest) error
RegisterEventHandler is the implementation of the RegisterEventHandler RPC
func UnregisterEventHandler ¶
func UnregisterEventHandler(ctx context.Context, req *bot.UnregisterEventHandlerRequest) error
UnregisterEventHandler is the implementation of the UnregisterEventHandler RPC
Types ¶
type Service ¶
Service is the server implementation of the bot API.
func GetService ¶
func GetService() *Service
GetService returns an initialized bot service instance.
func (*Service) AttachGuild ¶
func (svc *Service) AttachGuild(ctx context.Context, req *bot.AttachGuildRequest) (*emptypb.Empty, error)
AttachGuild enables taalabc service for a given guild.
func (*Service) DetachGuild ¶
func (svc *Service) DetachGuild(ctx context.Context, req *bot.DetachGuildRequest) (*emptypb.Empty, error)
DetachGuild disables taalabc service for a given guild.
func (*Service) DisableCommand ¶
func (svc *Service) DisableCommand(ctx context.Context, req *bot.DisableCommandRequest) (*emptypb.Empty, error)
DisableCommand disables a command for a given Discord guild.
func (*Service) EnableCommand ¶
func (svc *Service) EnableCommand(ctx context.Context, req *bot.EnableCommandRequest) (*emptypb.Empty, error)
EnableCommand enables a command for a given Discord guild.
func (*Service) ExecuteCommand ¶
func (svc *Service) ExecuteCommand(ctx context.Context, req *bot.CommandExecutionRequest) (*bot.CommandExecutionResult, error)
ExecuteCommand executes a bot command.
func (*Service) ListAttachedGuilds ¶
func (svc *Service) ListAttachedGuilds(ctx context.Context, _ *emptypb.Empty) (*bot.ListAttachedGuildsResponse, error)
ListAttachedGuilds retrieves guilds in which taalabc service is enabled.
func (*Service) ListExistingCommands ¶
func (svc *Service) ListExistingCommands(ctx context.Context, _ *emptypb.Empty) (*bot.ListExistingCommandsResponse, error)
ListExistingCommands sends metadata of all taalabc commands.
func (*Service) ListGuildCommands ¶
func (svc *Service) ListGuildCommands(ctx context.Context, req *bot.ListGuildCommandsRequest) (*bot.ListGuildCommandsResponse, error)
ListGuildCommands retrieves enabled commands for given Discord guild.
func (*Service) ListGuildEventHandlers ¶
func (svc *Service) ListGuildEventHandlers(ctx context.Context, req *bot.ListGuildEventHandlersRequest) (*bot.ListGuildEventHandlersResponse, error)
ListGuildEventHandlers retrieves registered event handlers for given Discord guild.
func (*Service) RegisterEventHandler ¶
func (svc *Service) RegisterEventHandler(ctx context.Context, req *bot.RegisterEventHandlerRequest) (*emptypb.Empty, error)
RegisterEventHandler registers an handler function for a given Discord guild and event.
func (*Service) UnregisterEventHandler ¶
func (svc *Service) UnregisterEventHandler(ctx context.Context, req *bot.UnregisterEventHandlerRequest) (*emptypb.Empty, error)
UnregisterEventHandler unregisters a handler function for a given Discord guild and event.