botserver

package
v0.0.0-...-07e1512 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2020 License: BSD-2-Clause Imports: 15 Imported by: 0

Documentation

Index

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

func DisableCommand(ctx context.Context, req *bot.DisableCommandRequest, svc *Service) error

DisableCommand is the implementation of the DisableCommand RPC

func EnableCommand

func EnableCommand(ctx context.Context, req *bot.EnableCommandRequest, svc *Service) error

EnableCommand is the implementation of the EnableCommand RPC

func ExecuteCommand

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

ListGuildCommands is the implementation of the ListGuildCommands RPC

func ListGuildEventHandlers

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

type Service struct {
	sync.Mutex
	// contains filtered or unexported fields
}

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

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

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.

Jump to

Keyboard shortcuts

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