Skip to main content

Bot

Documentation


Documentation / @discordeno/bot / Bot

Interface: Bot<TProps, TBehavior>

Defined in: bot/src/bot.ts:151

Type Parameters

TProps

TProps extends TransformersDesiredProperties = TransformersDesiredProperties

TBehavior

TBehavior extends DesiredPropertiesBehavior = RemoveKey

Properties

applicationId

applicationId: bigint

Defined in: bot/src/bot.ts:158

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/src/bot.ts:164

The event handlers.


gateway

gateway: GatewayManager

Defined in: bot/src/bot.ts:162

The gateway manager.


handlers

handlers: GatewayHandlers<TProps, TBehavior>

Defined in: bot/src/bot.ts:174

The handler functions that should handle incoming discord payloads from gateway and call an event.


helpers

helpers: BotHelpers<TProps, TBehavior>

Defined in: bot/src/bot.ts:175


id

id: bigint

Defined in: bot/src/bot.ts:156

The id of the bot.


logger

logger: Pick<typeof logger, "debug" | "info" | "warn" | "error" | "fatal">

Defined in: bot/src/bot.ts:166

A logger utility to make it easy to log nice and useful things in the bot code.


rest

rest: RestManager

Defined in: bot/src/bot.ts:160

The rest manager.


shutdown()

shutdown: () => Promise<void>

Defined in: bot/src/bot.ts:179

Shuts down all the bot connections to the gateway.

Returns

Promise<void>


start()

start: () => Promise<void>

Defined in: bot/src/bot.ts:177

Start the bot connection to the gateway.

Returns

Promise<void>


transformers

transformers: Transformers<TProps, TBehavior> & object

Defined in: bot/src/bot.ts:168

The functions that should transform discord objects to discordeno shaped objects.

Type declaration

$inferredTypes

$inferredTypes: object

$inferredTypes.activityInstance

activityInstance: ActivityInstance

$inferredTypes.activityLocation

activityLocation: ActivityLocation

$inferredTypes.attachment

attachment: Attachment

$inferredTypes.avatarDecorationData

avatarDecorationData: AvatarDecorationData

$inferredTypes.channel

channel: Channel

$inferredTypes.collectibles

collectibles: Collectibles

$inferredTypes.component

component: Component

$inferredTypes.defaultReactionEmoji

defaultReactionEmoji: DefaultReactionEmoji

$inferredTypes.emoji

emoji: Emoji

$inferredTypes.entitlement

entitlement: Entitlement

$inferredTypes.forumTag

forumTag: ForumTag

$inferredTypes.guild

guild: Guild

$inferredTypes.guildOnboarding

guildOnboarding: GuildOnboarding

$inferredTypes.guildOnboardingPrompt

guildOnboardingPrompt: GuildOnboardingPrompt

$inferredTypes.guildOnboardingPromptOption

guildOnboardingPromptOption: GuildOnboardingPromptOption

$inferredTypes.incidentsData

incidentsData: IncidentsData

$inferredTypes.interaction

interaction: Interaction

$inferredTypes.interactionCallback

interactionCallback: InteractionCallback

$inferredTypes.interactionCallbackResponse

interactionCallbackResponse: InteractionCallbackResponse

$inferredTypes.interactionResource

interactionResource: InteractionResource

$inferredTypes.invite

invite: Invite

$inferredTypes.inviteStageInstance

inviteStageInstance: InviteStageInstance

$inferredTypes.lobby

lobby: Lobby

$inferredTypes.lobbyMember

lobbyMember: LobbyMember

$inferredTypes.mediaGalleryItem

mediaGalleryItem: MediaGalleryItem

$inferredTypes.member

member: Member

$inferredTypes.message

message: Message

$inferredTypes.messageCall

messageCall: MessageCall

$inferredTypes.messageInteraction

messageInteraction: MessageInteraction

$inferredTypes.messageInteractionMetadata

messageInteractionMetadata: MessageInteractionMetadata

$inferredTypes.messagePin

messagePin: MessagePin

$inferredTypes.messageReference

messageReference: MessageReference

$inferredTypes.messageSnapshot

messageSnapshot: MessageSnapshot

$inferredTypes.nameplate

nameplate: Nameplate

$inferredTypes.poll

poll: Poll

$inferredTypes.pollAnswer

pollAnswer: PollAnswer

$inferredTypes.pollAnswerCount

pollAnswerCount: PollAnswerCount

$inferredTypes.pollMedia

pollMedia: PollMedia

$inferredTypes.pollResult

pollResult: PollResult

$inferredTypes.role

role: Role

$inferredTypes.roleColors

roleColors: RoleColors

$inferredTypes.scheduledEvent

scheduledEvent: ScheduledEvent

$inferredTypes.scheduledEventRecurrenceRule

scheduledEventRecurrenceRule: ScheduledEventRecurrenceRule

$inferredTypes.sku

sku: Sku

$inferredTypes.soundboardSound

soundboardSound: SoundboardSound

$inferredTypes.stageInstance

stageInstance: StageInstance

$inferredTypes.sticker

sticker: Sticker

$inferredTypes.subscription

subscription: Subscription

$inferredTypes.unfurledMediaItem

unfurledMediaItem: UnfurledMediaItem

$inferredTypes.user

user: User

$inferredTypes.userPrimaryGuild

userPrimaryGuild: UserPrimaryGuild

$inferredTypes.voiceState

voiceState: VoiceState

$inferredTypes.webhook

webhook: Webhook