Bot
Documentation / @discordeno/bot / Bot
Interface: Bot<TProps, TBehavior>
Defined in: bot.ts:144
Type Parameters
TProps
TProps extends TransformersDesiredProperties = TransformersDesiredProperties
TBehavior
TBehavior extends DesiredPropertiesBehavior = RemoveKey
Properties
applicationId
applicationId:
bigint
Defined in: bot.ts:151
The application id of the bot. This is usually the same as id but in the case of old bots can be different.
events
events:
Partial<EventHandlers<TProps,TBehavior>>
Defined in: bot.ts:157
The event handlers.
gateway
gateway:
GatewayManager
Defined in: bot.ts:155
The gateway manager.
handlers
handlers:
GatewayHandlers<TProps,TBehavior>
Defined in: bot.ts:167
The handler functions that should handle incoming discord payloads from gateway and call an event.
helpers
helpers:
BotHelpers<TProps,TBehavior>
Defined in: bot.ts:168
id
id:
bigint
Defined in: bot.ts:149
The id of the bot.
logger
logger:
Pick<typeoflogger,"debug"|"info"|"warn"|"error"|"fatal">
Defined in: bot.ts:159
A logger utility to make it easy to log nice and useful things in the bot code.
rest
rest:
RestManager
Defined in: bot.ts:153
The rest manager.
shutdown
shutdown: () =>
Promise<void>
Defined in: bot.ts:172
Shuts down all the bot connections to the gateway.
Returns
Promise<void>
start
start: () =>
Promise<void>
Defined in: bot.ts:170
Start the bot connection to the gateway.
Returns
Promise<void>
transformers
transformers:
TransformerFunctions<TProps,TBehavior> &object&object
Defined in: bot.ts:161
The functions that should transform discord objects to discordeno shaped objects.
Type Declaration
customizers
customizers:
TransformerCustomizers<TProps,TBehavior>
desiredProperties
desiredProperties:
TProps
reverse
reverse:
object
reverse.activity
activity: (
bot,payload) =>DiscordActivity
Parameters
bot
Bot<TProps, TBehavior>
payload
Returns
reverse.activityAssets
activityAssets: (
bot,payload) =>DiscordActivityAssets
Parameters
bot
Bot<TProps, TBehavior>
payload
Returns
reverse.allowedMentions
allowedMentions: (
bot,payload) =>DiscordAllowedMentions
Parameters
bot
Bot<TProps, TBehavior>
payload
Returns
reverse.application
application: (
bot,payload) =>DiscordApplication
Parameters
bot
Bot<TProps, TBehavior>
payload
Returns
reverse.applicationCommand
applicationCommand: (
bot,payload) =>DiscordApplicationCommand
Parameters
bot
Bot<TProps, TBehavior>
payload
Returns
reverse.applicationCommandOption
applicationCommandOption: (
bot,payload) =>DiscordApplicationCommandOption
Parameters
bot
Bot<TProps, TBehavior>
payload
Returns
DiscordApplicationCommandOption
reverse.applicationCommandOptionChoice
applicationCommandOptionChoice: (
bot,payload) =>DiscordApplicationCommandOptionChoice
Parameters
bot
Bot<TProps, TBehavior>
payload
ApplicationCommandOptionChoice
Returns
DiscordApplicationCommandOptionChoice
reverse.attachment
attachment: (
bot,payload) =>DiscordAttachment
Parameters
bot
Bot<TProps, TBehavior>
payload
SetupDesiredProps<Attachment, TProps, TBehavior>
Returns
reverse.collectibles
collectibles: (
bot,payload) =>DiscordCollectibles
Parameters
bot
Bot<TProps, TBehavior>
payload
SetupDesiredProps<Collectibles, TProps, TBehavior>
Returns
reverse.component
component: (
bot,payload) =>DiscordMessageComponent|DiscordMessageComponentFromModalInteractionResponse
Parameters
bot
Bot<TProps, TBehavior>
payload
Returns
DiscordMessageComponent | DiscordMessageComponentFromModalInteractionResponse
reverse.embed
embed: (
bot,payload) =>DiscordEmbed
Parameters
bot
Bot<TProps, TBehavior>
payload
Returns
reverse.mediaGalleryItem
mediaGalleryItem: (
bot,payload) =>DiscordMediaGalleryItem
Parameters
bot
Bot<TProps, TBehavior>
payload
Returns
reverse.member
member: (
bot,payload) =>DiscordMember
Parameters
bot
Bot<TProps, TBehavior>
payload
SetupDesiredProps<Member, TProps, TBehavior>
Returns
reverse.nameplate
nameplate: (
bot,payload) =>DiscordNameplate
Parameters
bot
Bot<TProps, TBehavior>
payload
SetupDesiredProps<Nameplate, TProps, TBehavior>
Returns
reverse.snowflake
snowflake: (
snowflake) =>string
Parameters
snowflake
Returns
string
reverse.team
team: (
bot,payload) =>DiscordTeam
Parameters
bot
Bot<TProps, TBehavior>
payload
Returns
reverse.unfurledMediaItem
unfurledMediaItem: (
bot,payload) =>DiscordUnfurledMediaItem
Parameters
bot
Bot<TProps, TBehavior>
payload
Returns
reverse.user
user: (
bot,payload) =>DiscordUser
Parameters
bot
Bot<TProps, TBehavior>
payload
SetupDesiredProps<User, TProps, TBehavior>
Returns
snowflake
snowflake: (
snowflake) =>bigint
Parameters
snowflake
Returns
bigint
Type Declaration
$inferredTypes
$inferredTypes:
object
$inferredTypes.activity
activity:
TransformerInformation<DiscordActivity,Activity,false>
$inferredTypes.activityAssets
activityAssets:
TransformerInformation<DiscordActivityAssets,ActivityAssets,false>
$inferredTypes.activityInstance
activityInstance:
TransformerInformation<DiscordActivityInstance,ActivityInstance,true>
$inferredTypes.activityLocation
activityLocation:
TransformerInformation<DiscordActivityLocation,ActivityLocation,true>
$inferredTypes.application
application:
TransformerInformation<DiscordApplication,Application,true, {shardId?:number; }>
$inferredTypes.applicationCommand
applicationCommand:
TransformerInformation<DiscordApplicationCommand,ApplicationCommand,false>
$inferredTypes.applicationCommandOption
applicationCommandOption:
TransformerInformation<DiscordApplicationCommandOption,ApplicationCommandOption,false>
$inferredTypes.applicationCommandOptionChoice
applicationCommandOptionChoice:
TransformerInformation<DiscordApplicationCommandOptionChoice,ApplicationCommandOptionChoice,false>
$inferredTypes.applicationCommandPermission
applicationCommandPermission:
TransformerInformation<DiscordGuildApplicationCommandPermissions,GuildApplicationCommandPermissions,false>
$inferredTypes.attachment
attachment:
TransformerInformation<DiscordAttachment,Attachment,true>
$inferredTypes.auditLogEntry
auditLogEntry:
TransformerInformation<DiscordAuditLogEntry,AuditLogEntry,false>
$inferredTypes.automodActionExecution
automodActionExecution:
TransformerInformation<DiscordAutoModerationActionExecution,AutoModerationActionExecution,false>
$inferredTypes.automodRule
automodRule:
TransformerInformation<DiscordAutoModerationRule,AutoModerationRule,false>
$inferredTypes.avatarDecorationData
avatarDecorationData:
TransformerInformation<DiscordAvatarDecorationData,AvatarDecorationData,true>
$inferredTypes.channel
channel:
TransformerInformation<DiscordChannel,Channel,true, {guildId?:BigString; }>
$inferredTypes.collectibles
collectibles:
TransformerInformation<DiscordCollectibles,Collectibles,true>
$inferredTypes.component
component:
TransformerInformation<DiscordMessageComponent|DiscordMessageComponentFromModalInteractionResponse,Component,true>
$inferredTypes.defaultReactionEmoji
defaultReactionEmoji:
TransformerInformation<DiscordDefaultReactionEmoji,DefaultReactionEmoji,true>
$inferredTypes.embed
embed:
TransformerInformation<DiscordEmbed,Embed,false>
$inferredTypes.emoji
emoji:
TransformerInformation<DiscordEmoji,Emoji,true>
$inferredTypes.entitlement
entitlement:
TransformerInformation<DiscordEntitlement,Entitlement,true>
$inferredTypes.forumTag
forumTag:
TransformerInformation<DiscordForumTag,ForumTag,true>
$inferredTypes.gatewayBot
gatewayBot:
TransformerInformation<DiscordGetGatewayBot,GetGatewayBot,false>
$inferredTypes.guild
guild:
TransformerInformation<DiscordGuild,Guild,true, {shardId?:number; }>
$inferredTypes.guildOnboarding
guildOnboarding:
TransformerInformation<DiscordGuildOnboarding,GuildOnboarding,true>
$inferredTypes.guildOnboardingPrompt
guildOnboardingPrompt:
TransformerInformation<DiscordGuildOnboardingPrompt,GuildOnboardingPrompt,true>
$inferredTypes.guildOnboardingPromptOption
guildOnboardingPromptOption:
TransformerInformation<DiscordGuildOnboardingPromptOption,GuildOnboardingPromptOption,true>
$inferredTypes.incidentsData
incidentsData:
TransformerInformation<DiscordIncidentsData,IncidentsData,true>
$inferredTypes.integration
integration:
TransformerInformation<DiscordIntegrationCreateUpdate,Integration,false>
$inferredTypes.interaction
interaction:
TransformerInformation<DiscordInteraction,Interaction,true, {shardId?:number; }>
$inferredTypes.interactionCallback
interactionCallback:
TransformerInformation<DiscordInteractionCallback,InteractionCallback,true>
$inferredTypes.interactionCallbackResponse
interactionCallbackResponse:
TransformerInformation<DiscordInteractionCallbackResponse,InteractionCallbackResponse,true, {shardId?:number; }>
$inferredTypes.interactionDataOptions
interactionDataOptions:
TransformerInformation<DiscordInteractionDataOption,InteractionDataOption,false>
$inferredTypes.interactionDataResolved
interactionDataResolved:
TransformerInformation<DiscordInteractionDataResolved,InteractionDataResolved,true, {guildId?:BigString;shardId?:number; }>
$inferredTypes.interactionResource
interactionResource:
TransformerInformation<DiscordInteractionResource,InteractionResource,true, {shardId?:number; }>
$inferredTypes.invite
invite:
TransformerInformation<DiscordInviteMetadata,Invite,true, {shardId?:number; }>
$inferredTypes.inviteStageInstance
inviteStageInstance:
TransformerInformation<DiscordInviteStageInstance,InviteStageInstance,true, {guildId?:BigString; }>
$inferredTypes.lobby
lobby:
TransformerInformation<DiscordLobby,Lobby,true>
$inferredTypes.lobbyInvite
lobbyInvite:
TransformerInformation<DiscordLobbyInvite,LobbyInvite,true>
$inferredTypes.lobbyMember
lobbyMember:
TransformerInformation<DiscordLobbyMember,LobbyMember,true>
$inferredTypes.lobbyMessage
lobbyMessage:
TransformerInformation<DiscordLobbyMessage,LobbyMessage,true>
$inferredTypes.mediaGalleryItem
mediaGalleryItem:
TransformerInformation<DiscordMediaGalleryItem,MediaGalleryItem,true>
$inferredTypes.member
member:
TransformerInformation<DiscordMember,Member,true, {guildId?:BigString;userId?:BigString; }>
$inferredTypes.message
message:
TransformerInformation<DiscordMessage,Message,true, {shardId?:number; }>
$inferredTypes.messageCall
messageCall:
TransformerInformation<DiscordMessageCall,MessageCall,true>
$inferredTypes.messageInteractionMetadata
messageInteractionMetadata:
TransformerInformation<DiscordMessageInteractionMetadata,MessageInteractionMetadata,true>
$inferredTypes.messagePin
messagePin:
TransformerInformation<DiscordMessagePin,MessagePin,true, {shardId?:number; }>
$inferredTypes.messageSnapshot
messageSnapshot:
TransformerInformation<DiscordMessageSnapshot,MessageSnapshot,true, {shardId?:number; }>
$inferredTypes.nameplate
nameplate:
TransformerInformation<DiscordNameplate,Nameplate,true>
$inferredTypes.poll
poll:
TransformerInformation<DiscordPoll,Poll,true>
$inferredTypes.pollMedia
pollMedia:
TransformerInformation<DiscordPollMedia,PollMedia,true>
$inferredTypes.presence
presence:
TransformerInformation<DiscordPresenceUpdate,PresenceUpdate,true>
$inferredTypes.role
role:
TransformerInformation<DiscordRole,Role,true, {guildId?:BigString; }>
$inferredTypes.roleColors
roleColors:
TransformerInformation<DiscordRoleColors,RoleColors,true>
$inferredTypes.scheduledEvent
scheduledEvent:
TransformerInformation<DiscordScheduledEvent,ScheduledEvent,true>
$inferredTypes.scheduledEventRecurrenceRule
scheduledEventRecurrenceRule:
TransformerInformation<DiscordScheduledEventRecurrenceRule,ScheduledEventRecurrenceRule,true>
$inferredTypes.sharedClientTheme
sharedClientTheme:
TransformerInformation<DiscordSharedClientTheme,SharedClientTheme,true>
$inferredTypes.sku
sku:
TransformerInformation<DiscordSku,Sku,true>
$inferredTypes.soundboardSound
soundboardSound:
TransformerInformation<DiscordSoundboardSound,SoundboardSound,true>
$inferredTypes.stageInstance
stageInstance:
TransformerInformation<DiscordStageInstance,StageInstance,true>
$inferredTypes.sticker
sticker:
TransformerInformation<DiscordSticker,Sticker,true>
$inferredTypes.stickerPack
stickerPack:
TransformerInformation<DiscordStickerPack,StickerPack,false>
$inferredTypes.subscription
subscription:
TransformerInformation<DiscordSubscription,Subscription,true>
$inferredTypes.team
team:
TransformerInformation<DiscordTeam,Team,false>
$inferredTypes.template
template:
TransformerInformation<DiscordTemplate,Template,false>
$inferredTypes.threadMember
threadMember:
TransformerInformation<DiscordThreadMember,ThreadMember,false,ThreadMemberTransformerExtra>
$inferredTypes.threadMemberGuildCreate
threadMemberGuildCreate:
TransformerInformation<DiscordThreadMemberGuildCreate,ThreadMemberGuildCreate,false>
$inferredTypes.unfurledMediaItem
unfurledMediaItem:
TransformerInformation<DiscordUnfurledMediaItem,UnfurledMediaItem,true>
$inferredTypes.user
user:
TransformerInformation<DiscordUser,User,true>
$inferredTypes.userPrimaryGuild
userPrimaryGuild:
TransformerInformation<DiscordUserPrimaryGuild,UserPrimaryGuild,true>
$inferredTypes.voiceRegion
voiceRegion:
TransformerInformation<DiscordVoiceRegion,VoiceRegion,false>
$inferredTypes.voiceState
voiceState:
TransformerInformation<DiscordVoiceState,VoiceState,true, {guildId?:BigString; }>
$inferredTypes.webhook
webhook:
TransformerInformation<DiscordWebhook,Webhook,true>
$inferredTypes.welcomeScreen
welcomeScreen:
TransformerInformation<DiscordWelcomeScreen,WelcomeScreen,false>
$inferredTypes.widget
widget:
TransformerInformation<DiscordGuildWidget,GuildWidget,false>
$inferredTypes.widgetSettings
widgetSettings:
TransformerInformation<DiscordGuildWidgetSettings,GuildWidgetSettings,false>