bot

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: 20 Imported by: 0

Documentation

Overview

Package bot is a generated twirp stub package. This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.11.0.

It is generated from these files:

rpc/bot/bot.proto

Index

Constants

View Source
const BotServicePathPrefix = "/twirp/taalapi.bot.BotService/"

BotServicePathPrefix is used for all URL paths on a twirp BotService server. Requests are always: POST BotServicePathPrefix/method It can be used in an HTTP mux to route twirp requests along with non-twirp requests on other routes.

Variables

View Source
var File_rpc_bot_bot_proto protoreflect.FileDescriptor

Functions

func WriteError

func WriteError(resp http.ResponseWriter, err error)

WriteError writes an HTTP response with a valid Twirp error format (code, msg, meta). Useful outside of the Twirp server (e.g. http middleware), but does not trigger hooks. If err is not a twirp.Error, it will get wrapped with twirp.InternalErrorWith(err)

Types

type AttachGuildRequest

type AttachGuildRequest struct {
	GuildId          string        `protobuf:"bytes,1,opt,name=guild_id,json=guildId,proto3" json:"guild_id,omitempty"`
	BotCommandPrefix string        `protobuf:"bytes,2,opt,name=bot_command_prefix,json=botCommandPrefix,proto3" json:"bot_command_prefix,omitempty"`
	GreetChannelId   string        `protobuf:"bytes,3,opt,name=greet_channel_id,json=greetChannelId,proto3" json:"greet_channel_id,omitempty"`
	LogChannelId     string        `protobuf:"bytes,4,opt,name=log_channel_id,json=logChannelId,proto3" json:"log_channel_id,omitempty"`
	GuildOwner       *discord.User `protobuf:"bytes,5,opt,name=guild_owner,json=guildOwner,proto3" json:"guild_owner,omitempty"`
	// contains filtered or unexported fields
}

AttachGuildRequest contains the Discord guild ID for which taalabc should start providing service, guild-specific parameters, and the guild owner user.

func (*AttachGuildRequest) Descriptor deprecated

func (*AttachGuildRequest) Descriptor() ([]byte, []int)

Deprecated: Use AttachGuildRequest.ProtoReflect.Descriptor instead.

func (*AttachGuildRequest) GetBotCommandPrefix

func (x *AttachGuildRequest) GetBotCommandPrefix() string

func (*AttachGuildRequest) GetGreetChannelId

func (x *AttachGuildRequest) GetGreetChannelId() string

func (*AttachGuildRequest) GetGuildId

func (x *AttachGuildRequest) GetGuildId() string

func (*AttachGuildRequest) GetGuildOwner

func (x *AttachGuildRequest) GetGuildOwner() *discord.User

func (*AttachGuildRequest) GetLogChannelId

func (x *AttachGuildRequest) GetLogChannelId() string

func (*AttachGuildRequest) ProtoMessage

func (*AttachGuildRequest) ProtoMessage()

func (*AttachGuildRequest) ProtoReflect

func (x *AttachGuildRequest) ProtoReflect() protoreflect.Message

func (*AttachGuildRequest) Reset

func (x *AttachGuildRequest) Reset()

func (*AttachGuildRequest) String

func (x *AttachGuildRequest) String() string

type AttachedGuild

type AttachedGuild struct {

	// Discord guild ID
	GuildId string `protobuf:"bytes,1,opt,name=guild_id,json=guildId,proto3" json:"guild_id,omitempty"`
	// Bot command prefix in this guild
	BotCommandPrefix string `protobuf:"bytes,2,opt,name=bot_command_prefix,json=botCommandPrefix,proto3" json:"bot_command_prefix,omitempty"`
	// List of enabled commands in this guild, identified by their name
	EnabledCommands []string `protobuf:"bytes,3,rep,name=enabled_commands,json=enabledCommands,proto3" json:"enabled_commands,omitempty"`
	// List of enabled event handlers in this guild
	EnabledEventHandlers []*EventHandler `protobuf:"bytes,4,rep,name=enabled_event_handlers,json=enabledEventHandlers,proto3" json:"enabled_event_handlers,omitempty"`
	// ID of the channel where new user greeting messages should be sent to
	GreetChannelId string `protobuf:"bytes,5,opt,name=greet_channel_id,json=greetChannelId,proto3" json:"greet_channel_id,omitempty"`
	// ID of the channel where taalabc logs should be sent to
	LogChannelId string `protobuf:"bytes,6,opt,name=log_channel_id,json=logChannelId,proto3" json:"log_channel_id,omitempty"`
	// Discord guild owner user
	// Always has all taalabc permissions for this guild
	GuildOwner *discord.User `protobuf:"bytes,7,opt,name=guild_owner,json=guildOwner,proto3" json:"guild_owner,omitempty"`
	// Delegated admin users
	// Users in this list have every permission for this guild except modifying
	// the delegated admin lists, and attaching/detaching the guild.
	DelegatedAdminUsers []*discord.User `protobuf:"bytes,8,rep,name=delegated_admin_users,json=delegatedAdminUsers,proto3" json:"delegated_admin_users,omitempty"`
	// Delegated admin roles
	// Users with any role present in this list have every permission for this guild
	// except modifying the delegated admin lists, and attaching/detaching the guild.
	DelegatedAdminRoles []*discord.Role `protobuf:"bytes,9,rep,name=delegated_admin_roles,json=delegatedAdminRoles,proto3" json:"delegated_admin_roles,omitempty"`
	// contains filtered or unexported fields
}

AttachedGuild contains all the data taalapi needs to provide service to a Discord guild, including guild ID and guild-specific parameters.

func (*AttachedGuild) Descriptor deprecated

func (*AttachedGuild) Descriptor() ([]byte, []int)

Deprecated: Use AttachedGuild.ProtoReflect.Descriptor instead.

func (*AttachedGuild) GetBotCommandPrefix

func (x *AttachedGuild) GetBotCommandPrefix() string

func (*AttachedGuild) GetDelegatedAdminRoles

func (x *AttachedGuild) GetDelegatedAdminRoles() []*discord.Role

func (*AttachedGuild) GetDelegatedAdminUsers

func (x *AttachedGuild) GetDelegatedAdminUsers() []*discord.User

func (*AttachedGuild) GetEnabledCommands

func (x *AttachedGuild) GetEnabledCommands() []string

func (*AttachedGuild) GetEnabledEventHandlers

func (x *AttachedGuild) GetEnabledEventHandlers() []*EventHandler

func (*AttachedGuild) GetGreetChannelId

func (x *AttachedGuild) GetGreetChannelId() string

func (*AttachedGuild) GetGuildId

func (x *AttachedGuild) GetGuildId() string

func (*AttachedGuild) GetGuildOwner

func (x *AttachedGuild) GetGuildOwner() *discord.User

func (*AttachedGuild) GetLogChannelId

func (x *AttachedGuild) GetLogChannelId() string

func (*AttachedGuild) ProtoMessage

func (*AttachedGuild) ProtoMessage()

func (*AttachedGuild) ProtoReflect

func (x *AttachedGuild) ProtoReflect() protoreflect.Message

func (*AttachedGuild) Reset

func (x *AttachedGuild) Reset()

func (*AttachedGuild) String

func (x *AttachedGuild) String() string

type BotService

type BotService interface {
	// ListExistingCommands sends metadata of all taalabc commands.
	ListExistingCommands(context.Context, *google_protobuf.Empty) (*ListExistingCommandsResponse, error)

	// ListAttachedGuilds retrieves guilds in which taalabc service is enabled.
	ListAttachedGuilds(context.Context, *google_protobuf.Empty) (*ListAttachedGuildsResponse, error)

	// AttachGuild enables taalabc service for a given guild.
	AttachGuild(context.Context, *AttachGuildRequest) (*google_protobuf.Empty, error)

	// DetachGuild disables taalabc service for a given guild.
	DetachGuild(context.Context, *DetachGuildRequest) (*google_protobuf.Empty, error)

	// ListGuildCommands retrieves enabled commands for given Discord guild.
	ListGuildCommands(context.Context, *ListGuildCommandsRequest) (*ListGuildCommandsResponse, error)

	// EnableCommand enables a command for a given Discord guild.
	EnableCommand(context.Context, *EnableCommandRequest) (*google_protobuf.Empty, error)

	// DisableCommand disables a command for a given Discord guild.
	DisableCommand(context.Context, *DisableCommandRequest) (*google_protobuf.Empty, error)

	// ExecuteCommand executes a bot command.
	ExecuteCommand(context.Context, *CommandExecutionRequest) (*CommandExecutionResult, error)

	// ListGuildEventHandlers retrieves registered event handlers for given Discord guild.
	ListGuildEventHandlers(context.Context, *ListGuildEventHandlersRequest) (*ListGuildEventHandlersResponse, error)

	// RegisterEventHandler registers an handler function for a given Discord guild and event.
	RegisterEventHandler(context.Context, *RegisterEventHandlerRequest) (*google_protobuf.Empty, error)

	// UnregisterEventHandler unregisters a handler function for a given Discord guild and event.
	UnregisterEventHandler(context.Context, *UnregisterEventHandlerRequest) (*google_protobuf.Empty, error)
}

func NewBotServiceJSONClient

func NewBotServiceJSONClient(addr string, client HTTPClient, opts ...twirp.ClientOption) BotService

NewBotServiceJSONClient creates a JSON client that implements the BotService interface. It communicates using JSON and can be configured with a custom HTTPClient.

func NewBotServiceProtobufClient

func NewBotServiceProtobufClient(addr string, client HTTPClient, opts ...twirp.ClientOption) BotService

NewBotServiceProtobufClient creates a Protobuf client that implements the BotService interface. It communicates using Protobuf and can be configured with a custom HTTPClient.

type CommandExecutionRequest

type CommandExecutionRequest struct {
	GuildId     string   `protobuf:"bytes,1,opt,name=guild_id,json=guildId,proto3" json:"guild_id,omitempty"`
	CommandName string   `protobuf:"bytes,2,opt,name=command_name,json=commandName,proto3" json:"command_name,omitempty"`
	CommandArgs []string `protobuf:"bytes,3,rep,name=command_args,json=commandArgs,proto3" json:"command_args,omitempty"`
	// contains filtered or unexported fields
}

CommandExecutionRequest contains ID of the Discord guild from where the request originates, and the name and arguments of the command to execute.

func (*CommandExecutionRequest) Descriptor deprecated

func (*CommandExecutionRequest) Descriptor() ([]byte, []int)

Deprecated: Use CommandExecutionRequest.ProtoReflect.Descriptor instead.

func (*CommandExecutionRequest) GetCommandArgs

func (x *CommandExecutionRequest) GetCommandArgs() []string

func (*CommandExecutionRequest) GetCommandName

func (x *CommandExecutionRequest) GetCommandName() string

func (*CommandExecutionRequest) GetGuildId

func (x *CommandExecutionRequest) GetGuildId() string

func (*CommandExecutionRequest) ProtoMessage

func (*CommandExecutionRequest) ProtoMessage()

func (*CommandExecutionRequest) ProtoReflect

func (x *CommandExecutionRequest) ProtoReflect() protoreflect.Message

func (*CommandExecutionRequest) Reset

func (x *CommandExecutionRequest) Reset()

func (*CommandExecutionRequest) String

func (x *CommandExecutionRequest) String() string

type CommandExecutionResult

type CommandExecutionResult struct {

	// Types that are assignable to Action:
	//	*CommandExecutionResult_NoAction
	//	*CommandExecutionResult_SendMessage
	Action isCommandExecutionResult_Action `protobuf_oneof:"action"`
	// contains filtered or unexported fields
}

func (*CommandExecutionResult) Descriptor deprecated

func (*CommandExecutionResult) Descriptor() ([]byte, []int)

Deprecated: Use CommandExecutionResult.ProtoReflect.Descriptor instead.

func (*CommandExecutionResult) GetAction

func (m *CommandExecutionResult) GetAction() isCommandExecutionResult_Action

func (*CommandExecutionResult) GetNoAction

func (x *CommandExecutionResult) GetNoAction() *empty.Empty

func (*CommandExecutionResult) GetSendMessage

func (x *CommandExecutionResult) GetSendMessage() *discord.SendMessagePayload

func (*CommandExecutionResult) ProtoMessage

func (*CommandExecutionResult) ProtoMessage()

func (*CommandExecutionResult) ProtoReflect

func (x *CommandExecutionResult) ProtoReflect() protoreflect.Message

func (*CommandExecutionResult) Reset

func (x *CommandExecutionResult) Reset()

func (*CommandExecutionResult) String

func (x *CommandExecutionResult) String() string

type CommandExecutionResult_NoAction

type CommandExecutionResult_NoAction struct {
	NoAction *empty.Empty `protobuf:"bytes,1,opt,name=no_action,json=noAction,proto3,oneof"`
}

type CommandExecutionResult_SendMessage

type CommandExecutionResult_SendMessage struct {
	SendMessage *discord.SendMessagePayload `protobuf:"bytes,2,opt,name=send_message,json=sendMessage,proto3,oneof"` // TODO(thepib): add support for other result kinds (e.g. message reaction)
}

type CommandMeta

type CommandMeta struct {
	Name        string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Description string   `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	Aliases     []string `protobuf:"bytes,3,rep,name=aliases,proto3" json:"aliases,omitempty"`
	// contains filtered or unexported fields
}

Discord bot command metadata

func (*CommandMeta) Descriptor deprecated

func (*CommandMeta) Descriptor() ([]byte, []int)

Deprecated: Use CommandMeta.ProtoReflect.Descriptor instead.

func (*CommandMeta) GetAliases

func (x *CommandMeta) GetAliases() []string

func (*CommandMeta) GetDescription

func (x *CommandMeta) GetDescription() string

func (*CommandMeta) GetName

func (x *CommandMeta) GetName() string

func (*CommandMeta) ProtoMessage

func (*CommandMeta) ProtoMessage()

func (*CommandMeta) ProtoReflect

func (x *CommandMeta) ProtoReflect() protoreflect.Message

func (*CommandMeta) Reset

func (x *CommandMeta) Reset()

func (*CommandMeta) String

func (x *CommandMeta) String() string

type DetachGuildRequest

type DetachGuildRequest struct {
	GuildId string `protobuf:"bytes,1,opt,name=guild_id,json=guildId,proto3" json:"guild_id,omitempty"`
	// contains filtered or unexported fields
}

DetachGuildRequest contains the Discord guild ID for which taalabc should stop providing service.

func (*DetachGuildRequest) Descriptor deprecated

func (*DetachGuildRequest) Descriptor() ([]byte, []int)

Deprecated: Use DetachGuildRequest.ProtoReflect.Descriptor instead.

func (*DetachGuildRequest) GetGuildId

func (x *DetachGuildRequest) GetGuildId() string

func (*DetachGuildRequest) ProtoMessage

func (*DetachGuildRequest) ProtoMessage()

func (*DetachGuildRequest) ProtoReflect

func (x *DetachGuildRequest) ProtoReflect() protoreflect.Message

func (*DetachGuildRequest) Reset

func (x *DetachGuildRequest) Reset()

func (*DetachGuildRequest) String

func (x *DetachGuildRequest) String() string

type DisableCommandRequest

type DisableCommandRequest struct {
	GuildId     string `protobuf:"bytes,1,opt,name=guild_id,json=guildId,proto3" json:"guild_id,omitempty"`
	CommandName string `protobuf:"bytes,2,opt,name=command_name,json=commandName,proto3" json:"command_name,omitempty"`
	// contains filtered or unexported fields
}

DisableCommandRequest contains target Discord guild ID and command to disable.

func (*DisableCommandRequest) Descriptor deprecated

func (*DisableCommandRequest) Descriptor() ([]byte, []int)

Deprecated: Use DisableCommandRequest.ProtoReflect.Descriptor instead.

func (*DisableCommandRequest) GetCommandName

func (x *DisableCommandRequest) GetCommandName() string

func (*DisableCommandRequest) GetGuildId

func (x *DisableCommandRequest) GetGuildId() string

func (*DisableCommandRequest) ProtoMessage

func (*DisableCommandRequest) ProtoMessage()

func (*DisableCommandRequest) ProtoReflect

func (x *DisableCommandRequest) ProtoReflect() protoreflect.Message

func (*DisableCommandRequest) Reset

func (x *DisableCommandRequest) Reset()

func (*DisableCommandRequest) String

func (x *DisableCommandRequest) String() string

type EnableCommandRequest

type EnableCommandRequest struct {
	GuildId     string `protobuf:"bytes,1,opt,name=guild_id,json=guildId,proto3" json:"guild_id,omitempty"`
	CommandName string `protobuf:"bytes,2,opt,name=command_name,json=commandName,proto3" json:"command_name,omitempty"`
	// contains filtered or unexported fields
}

EnableCommandRequest contains target Discord guild ID and command to enable.

func (*EnableCommandRequest) Descriptor deprecated

func (*EnableCommandRequest) Descriptor() ([]byte, []int)

Deprecated: Use EnableCommandRequest.ProtoReflect.Descriptor instead.

func (*EnableCommandRequest) GetCommandName

func (x *EnableCommandRequest) GetCommandName() string

func (*EnableCommandRequest) GetGuildId

func (x *EnableCommandRequest) GetGuildId() string

func (*EnableCommandRequest) ProtoMessage

func (*EnableCommandRequest) ProtoMessage()

func (*EnableCommandRequest) ProtoReflect

func (x *EnableCommandRequest) ProtoReflect() protoreflect.Message

func (*EnableCommandRequest) Reset

func (x *EnableCommandRequest) Reset()

func (*EnableCommandRequest) String

func (x *EnableCommandRequest) String() string

type EventHandler

type EventHandler struct {
	Event        discord.Event `protobuf:"varint,1,opt,name=event,proto3,enum=taalapi.discord.Event" json:"event,omitempty"`
	FunctionName string        `protobuf:"bytes,2,opt,name=function_name,json=functionName,proto3" json:"function_name,omitempty"`
	// contains filtered or unexported fields
}

EventHandler is a (event, handler function name) pair.

func (*EventHandler) Descriptor deprecated

func (*EventHandler) Descriptor() ([]byte, []int)

Deprecated: Use EventHandler.ProtoReflect.Descriptor instead.

func (*EventHandler) GetEvent

func (x *EventHandler) GetEvent() discord.Event

func (*EventHandler) GetFunctionName

func (x *EventHandler) GetFunctionName() string

func (*EventHandler) ProtoMessage

func (*EventHandler) ProtoMessage()

func (*EventHandler) ProtoReflect

func (x *EventHandler) ProtoReflect() protoreflect.Message

func (*EventHandler) Reset

func (x *EventHandler) Reset()

func (*EventHandler) String

func (x *EventHandler) String() string

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient is the interface used by generated clients to send HTTP requests. It is fulfilled by *(net/http).Client, which is sufficient for most users. Users can provide their own implementation for special retry policies.

HTTPClient implementations should not follow redirects. Redirects are automatically disabled if *(net/http).Client is passed to client constructors. See the withoutRedirects function in this file for more details.

type ListAttachedGuildsResponse

type ListAttachedGuildsResponse struct {
	Guilds []*AttachedGuild `protobuf:"bytes,1,rep,name=guilds,proto3" json:"guilds,omitempty"`
	// contains filtered or unexported fields
}

ListAttachedGuildsResponse contains the list of Discord guilds in which taalabc service is enabled.

func (*ListAttachedGuildsResponse) Descriptor deprecated

func (*ListAttachedGuildsResponse) Descriptor() ([]byte, []int)

Deprecated: Use ListAttachedGuildsResponse.ProtoReflect.Descriptor instead.

func (*ListAttachedGuildsResponse) GetGuilds

func (x *ListAttachedGuildsResponse) GetGuilds() []*AttachedGuild

func (*ListAttachedGuildsResponse) ProtoMessage

func (*ListAttachedGuildsResponse) ProtoMessage()

func (*ListAttachedGuildsResponse) ProtoReflect

func (*ListAttachedGuildsResponse) Reset

func (x *ListAttachedGuildsResponse) Reset()

func (*ListAttachedGuildsResponse) String

func (x *ListAttachedGuildsResponse) String() string

type ListExistingCommandsResponse

type ListExistingCommandsResponse struct {
	Commands []*CommandMeta `protobuf:"bytes,1,rep,name=commands,proto3" json:"commands,omitempty"`
	// contains filtered or unexported fields
}

ListExistingCommandsResponse contains the list of all taalabc commands.

func (*ListExistingCommandsResponse) Descriptor deprecated

func (*ListExistingCommandsResponse) Descriptor() ([]byte, []int)

Deprecated: Use ListExistingCommandsResponse.ProtoReflect.Descriptor instead.

func (*ListExistingCommandsResponse) GetCommands

func (x *ListExistingCommandsResponse) GetCommands() []*CommandMeta

func (*ListExistingCommandsResponse) ProtoMessage

func (*ListExistingCommandsResponse) ProtoMessage()

func (*ListExistingCommandsResponse) ProtoReflect

func (*ListExistingCommandsResponse) Reset

func (x *ListExistingCommandsResponse) Reset()

func (*ListExistingCommandsResponse) String

type ListGuildCommandsRequest

type ListGuildCommandsRequest struct {
	GuildId string `protobuf:"bytes,1,opt,name=guild_id,json=guildId,proto3" json:"guild_id,omitempty"`
	// contains filtered or unexported fields
}

ListGuildCommandsRequest contains the Discord guild ID for which enabled commands should be retrieved.

func (*ListGuildCommandsRequest) Descriptor deprecated

func (*ListGuildCommandsRequest) Descriptor() ([]byte, []int)

Deprecated: Use ListGuildCommandsRequest.ProtoReflect.Descriptor instead.

func (*ListGuildCommandsRequest) GetGuildId

func (x *ListGuildCommandsRequest) GetGuildId() string

func (*ListGuildCommandsRequest) ProtoMessage

func (*ListGuildCommandsRequest) ProtoMessage()

func (*ListGuildCommandsRequest) ProtoReflect

func (x *ListGuildCommandsRequest) ProtoReflect() protoreflect.Message

func (*ListGuildCommandsRequest) Reset

func (x *ListGuildCommandsRequest) Reset()

func (*ListGuildCommandsRequest) String

func (x *ListGuildCommandsRequest) String() string

type ListGuildCommandsResponse

type ListGuildCommandsResponse struct {
	EnabledCommands []*CommandMeta `protobuf:"bytes,1,rep,name=enabled_commands,json=enabledCommands,proto3" json:"enabled_commands,omitempty"`
	// contains filtered or unexported fields
}

ListGuildCommandsResponse contains the list of enabled taalabc commands in the Discord guild.

func (*ListGuildCommandsResponse) Descriptor deprecated

func (*ListGuildCommandsResponse) Descriptor() ([]byte, []int)

Deprecated: Use ListGuildCommandsResponse.ProtoReflect.Descriptor instead.

func (*ListGuildCommandsResponse) GetEnabledCommands

func (x *ListGuildCommandsResponse) GetEnabledCommands() []*CommandMeta

func (*ListGuildCommandsResponse) ProtoMessage

func (*ListGuildCommandsResponse) ProtoMessage()

func (*ListGuildCommandsResponse) ProtoReflect

func (*ListGuildCommandsResponse) Reset

func (x *ListGuildCommandsResponse) Reset()

func (*ListGuildCommandsResponse) String

func (x *ListGuildCommandsResponse) String() string

type ListGuildEventHandlersRequest

type ListGuildEventHandlersRequest struct {
	GuildId string `protobuf:"bytes,1,opt,name=guild_id,json=guildId,proto3" json:"guild_id,omitempty"`
	// contains filtered or unexported fields
}

ListGuildEventHandlersRequest contains the Discord guild ID for which registered event handlers should be retrieved.

func (*ListGuildEventHandlersRequest) Descriptor deprecated

func (*ListGuildEventHandlersRequest) Descriptor() ([]byte, []int)

Deprecated: Use ListGuildEventHandlersRequest.ProtoReflect.Descriptor instead.

func (*ListGuildEventHandlersRequest) GetGuildId

func (x *ListGuildEventHandlersRequest) GetGuildId() string

func (*ListGuildEventHandlersRequest) ProtoMessage

func (*ListGuildEventHandlersRequest) ProtoMessage()

func (*ListGuildEventHandlersRequest) ProtoReflect

func (*ListGuildEventHandlersRequest) Reset

func (x *ListGuildEventHandlersRequest) Reset()

func (*ListGuildEventHandlersRequest) String

type ListGuildEventHandlersResponse

type ListGuildEventHandlersResponse struct {
	EnabledEventHandlers []*EventHandler `protobuf:"bytes,1,rep,name=enabled_event_handlers,json=enabledEventHandlers,proto3" json:"enabled_event_handlers,omitempty"`
	// contains filtered or unexported fields
}

ListGuildEventHandlersResponse contains the list of enabled event handlers in the Discord guild.

func (*ListGuildEventHandlersResponse) Descriptor deprecated

func (*ListGuildEventHandlersResponse) Descriptor() ([]byte, []int)

Deprecated: Use ListGuildEventHandlersResponse.ProtoReflect.Descriptor instead.

func (*ListGuildEventHandlersResponse) GetEnabledEventHandlers

func (x *ListGuildEventHandlersResponse) GetEnabledEventHandlers() []*EventHandler

func (*ListGuildEventHandlersResponse) ProtoMessage

func (*ListGuildEventHandlersResponse) ProtoMessage()

func (*ListGuildEventHandlersResponse) ProtoReflect

func (*ListGuildEventHandlersResponse) Reset

func (x *ListGuildEventHandlersResponse) Reset()

func (*ListGuildEventHandlersResponse) String

type ListGuildsOwnedByResponse

type ListGuildsOwnedByResponse struct {
	Guilds []*discord.UserGuild `protobuf:"bytes,1,rep,name=guilds,proto3" json:"guilds,omitempty"`
	// contains filtered or unexported fields
}

ListGuildsOwnedByResponse contains the list of Discord guilds owned by user passed to the request.

func (*ListGuildsOwnedByResponse) Descriptor deprecated

func (*ListGuildsOwnedByResponse) Descriptor() ([]byte, []int)

Deprecated: Use ListGuildsOwnedByResponse.ProtoReflect.Descriptor instead.

func (*ListGuildsOwnedByResponse) GetGuilds

func (x *ListGuildsOwnedByResponse) GetGuilds() []*discord.UserGuild

func (*ListGuildsOwnedByResponse) ProtoMessage

func (*ListGuildsOwnedByResponse) ProtoMessage()

func (*ListGuildsOwnedByResponse) ProtoReflect

func (*ListGuildsOwnedByResponse) Reset

func (x *ListGuildsOwnedByResponse) Reset()

func (*ListGuildsOwnedByResponse) String

func (x *ListGuildsOwnedByResponse) String() string

type RegisterEventHandlerRequest

type RegisterEventHandlerRequest struct {
	GuildId      string        `protobuf:"bytes,1,opt,name=guild_id,json=guildId,proto3" json:"guild_id,omitempty"`
	Event        discord.Event `protobuf:"varint,2,opt,name=event,proto3,enum=taalapi.discord.Event" json:"event,omitempty"`
	FunctionName string        `protobuf:"bytes,3,opt,name=function_name,json=functionName,proto3" json:"function_name,omitempty"`
	// contains filtered or unexported fields
}

RegisterEventHandlerRequest contains target Discord guild ID, target Discord event and handler function name to register.

func (*RegisterEventHandlerRequest) Descriptor deprecated

func (*RegisterEventHandlerRequest) Descriptor() ([]byte, []int)

Deprecated: Use RegisterEventHandlerRequest.ProtoReflect.Descriptor instead.

func (*RegisterEventHandlerRequest) GetEvent

func (*RegisterEventHandlerRequest) GetFunctionName

func (x *RegisterEventHandlerRequest) GetFunctionName() string

func (*RegisterEventHandlerRequest) GetGuildId

func (x *RegisterEventHandlerRequest) GetGuildId() string

func (*RegisterEventHandlerRequest) ProtoMessage

func (*RegisterEventHandlerRequest) ProtoMessage()

func (*RegisterEventHandlerRequest) ProtoReflect

func (*RegisterEventHandlerRequest) Reset

func (x *RegisterEventHandlerRequest) Reset()

func (*RegisterEventHandlerRequest) String

func (x *RegisterEventHandlerRequest) String() string

type TwirpServer

type TwirpServer interface {
	http.Handler
	// ServiceDescriptor returns gzipped bytes describing the .proto file that
	// this service was generated from. Once unzipped, the bytes can be
	// unmarshalled as a
	// github.com/golang/protobuf/protoc-gen-go/descriptor.FileDescriptorProto.
	//
	// The returned integer is the index of this particular service within that
	// FileDescriptorProto's 'Service' slice of ServiceDescriptorProtos. This is a
	// low-level field, expected to be used for reflection.
	ServiceDescriptor() ([]byte, int)
	// ProtocGenTwirpVersion is the semantic version string of the version of
	// twirp used to generate this file.
	ProtocGenTwirpVersion() string
	// PathPrefix returns the HTTP URL path prefix for all methods handled by this
	// service. This can be used with an HTTP mux to route twirp requests
	// alongside non-twirp requests on one HTTP listener.
	PathPrefix() string
}

TwirpServer is the interface generated server structs will support: they're HTTP handlers with additional methods for accessing metadata about the service. Those accessors are a low-level API for building reflection tools. Most people can think of TwirpServers as just http.Handlers.

func NewBotServiceServer

func NewBotServiceServer(svc BotService, hooks *twirp.ServerHooks) TwirpServer

type UnregisterEventHandlerRequest

type UnregisterEventHandlerRequest struct {
	GuildId      string        `protobuf:"bytes,1,opt,name=guild_id,json=guildId,proto3" json:"guild_id,omitempty"`
	Event        discord.Event `protobuf:"varint,2,opt,name=event,proto3,enum=taalapi.discord.Event" json:"event,omitempty"`
	FunctionName string        `protobuf:"bytes,3,opt,name=function_name,json=functionName,proto3" json:"function_name,omitempty"`
	// contains filtered or unexported fields
}

UnregisterEventHandlerRequest contains target Discord guild ID, target Discord event and handler function name to unregister.

func (*UnregisterEventHandlerRequest) Descriptor deprecated

func (*UnregisterEventHandlerRequest) Descriptor() ([]byte, []int)

Deprecated: Use UnregisterEventHandlerRequest.ProtoReflect.Descriptor instead.

func (*UnregisterEventHandlerRequest) GetEvent

func (*UnregisterEventHandlerRequest) GetFunctionName

func (x *UnregisterEventHandlerRequest) GetFunctionName() string

func (*UnregisterEventHandlerRequest) GetGuildId

func (x *UnregisterEventHandlerRequest) GetGuildId() string

func (*UnregisterEventHandlerRequest) ProtoMessage

func (*UnregisterEventHandlerRequest) ProtoMessage()

func (*UnregisterEventHandlerRequest) ProtoReflect

func (*UnregisterEventHandlerRequest) Reset

func (x *UnregisterEventHandlerRequest) Reset()

func (*UnregisterEventHandlerRequest) String

Jump to

Keyboard shortcuts

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