Skip to main content

Bot

@discordeno/botDocs


Documentation / @discordeno/bot / Bot

Interface: Bot<TProps, TBehavior>

Type Parameters

TProps extends TransformersDesiredProperties = TransformersDesiredProperties

TBehavior extends DesiredPropertiesBehavior = RemoveKey

Properties

applicationId

applicationId: bigint

The application id of the bot. This is usually the same as id but in the case of old bots can be different.

Defined in

packages/bot/src/bot.ts:149


events

events: Partial<EventHandlers<TProps, TBehavior, Bot<TProps, TBehavior>>>

The event handlers.

Defined in

packages/bot/src/bot.ts:155


gateway

gateway: GatewayManager

The gateway manager.

Defined in

packages/bot/src/bot.ts:153


handlers

handlers: GatewayHandlers<TProps, TBehavior>

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

Defined in

packages/bot/src/bot.ts:165


helpers

helpers: BotHelpers<TProps, TBehavior, Bot<TProps, TBehavior>>

Defined in

packages/bot/src/bot.ts:166


id

id: bigint

The id of the bot.

Defined in

packages/bot/src/bot.ts:147


logger

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

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

Type declaration

debug()

debug: (...args) => void

Parameters

• ...args: any[]

Returns

void

error()

error: (...args) => void

Parameters

• ...args: any[]

Returns

void

fatal()

fatal: (...args) => void

Parameters

• ...args: any[]

Returns

void

info()

info: (...args) => void

Parameters

• ...args: any[]

Returns

void

log()

log: (level, ...args) => void

Parameters

level: LogLevels

• ...args: any[]

Returns

void

setDepth()

setDepth: (level) => void

Parameters

level: LogDepth

Returns

void

setLevel()

setLevel: (level) => void

Parameters

level: LogLevels

Returns

void

warn()

warn: (...args) => void

Parameters

• ...args: any[]

Returns

void

Defined in

packages/bot/src/bot.ts:157


rest

rest: RestManager

The rest manager.

Defined in

packages/bot/src/bot.ts:151


shutdown()

shutdown: () => Promise<void>

Shuts down all the bot connections to the gateway.

Returns

Promise<void>

Defined in

packages/bot/src/bot.ts:170


start()

start: () => Promise<void>

Start the bot connection to the gateway.

Returns

Promise<void>

Defined in

packages/bot/src/bot.ts:168


transformers

transformers: Transformers<TProps, TBehavior, Bot<TProps, TBehavior>> & object

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

Type declaration

$inferredTypes

$inferredTypes: object

$inferredTypes.activityInstance

$inferredTypes.activityInstance: SetupDesiredProps<ActivityInstance, TProps, TBehavior>

$inferredTypes.activityLocation

$inferredTypes.activityLocation: SetupDesiredProps<ActivityLocation, TProps, TBehavior>

$inferredTypes.attachment

$inferredTypes.attachment: SetupDesiredProps<Attachment, TProps, TBehavior>

$inferredTypes.avatarDecorationData

$inferredTypes.avatarDecorationData: SetupDesiredProps<AvatarDecorationData, TProps, TBehavior>

$inferredTypes.channel

$inferredTypes.channel: SetupDesiredProps<Channel, TProps, TBehavior>

$inferredTypes.defaultReactionEmoji

$inferredTypes.defaultReactionEmoji: SetupDesiredProps<DefaultReactionEmoji, TProps, TBehavior>

$inferredTypes.emoji

$inferredTypes.emoji: SetupDesiredProps<Emoji, TProps, TBehavior>

$inferredTypes.entitlement

$inferredTypes.entitlement: SetupDesiredProps<Entitlement, TProps, TBehavior>

$inferredTypes.forumTag

$inferredTypes.forumTag: SetupDesiredProps<ForumTag, TProps, TBehavior>

$inferredTypes.guild

$inferredTypes.guild: SetupDesiredProps<Guild, TProps, TBehavior>

$inferredTypes.guildOnboarding

$inferredTypes.guildOnboarding: SetupDesiredProps<GuildOnboarding, TProps, TBehavior>

$inferredTypes.guildOnboardingPrompt

$inferredTypes.guildOnboardingPrompt: SetupDesiredProps<GuildOnboardingPrompt, TProps, TBehavior>

$inferredTypes.guildOnboardingPromptOption

$inferredTypes.guildOnboardingPromptOption: SetupDesiredProps<GuildOnboardingPromptOption, TProps, TBehavior>

$inferredTypes.interaction

$inferredTypes.interaction: SetupDesiredProps<Interaction, TProps, TBehavior>

$inferredTypes.interactionCallback

$inferredTypes.interactionCallback: SetupDesiredProps<InteractionCallback, TProps, TBehavior>

$inferredTypes.interactionCallbackResponse

$inferredTypes.interactionCallbackResponse: SetupDesiredProps<InteractionCallbackResponse, TProps, TBehavior>

$inferredTypes.interactionResource

$inferredTypes.interactionResource: SetupDesiredProps<InteractionResource, TProps, TBehavior>

$inferredTypes.invite

$inferredTypes.invite: SetupDesiredProps<Invite, TProps, TBehavior>

$inferredTypes.inviteStageInstance

$inferredTypes.inviteStageInstance: SetupDesiredProps<InviteStageInstance, TProps, TBehavior>

$inferredTypes.member

$inferredTypes.member: SetupDesiredProps<Member, TProps, TBehavior>

$inferredTypes.message

$inferredTypes.message: SetupDesiredProps<Message, TProps, TBehavior>

$inferredTypes.messageCall

$inferredTypes.messageCall: SetupDesiredProps<MessageCall, TProps, TBehavior>

$inferredTypes.messageInteraction

$inferredTypes.messageInteraction: SetupDesiredProps<MessageInteraction, TProps, TBehavior>

$inferredTypes.messageInteractionMetadata

$inferredTypes.messageInteractionMetadata: SetupDesiredProps<MessageInteractionMetadata, TProps, TBehavior>

$inferredTypes.messageReference

$inferredTypes.messageReference: SetupDesiredProps<MessageReference, TProps, TBehavior>

$inferredTypes.messageSnapshot

$inferredTypes.messageSnapshot: SetupDesiredProps<MessageSnapshot, TProps, TBehavior>

$inferredTypes.poll

$inferredTypes.poll: SetupDesiredProps<Poll, TProps, TBehavior>

$inferredTypes.pollAnswer

$inferredTypes.pollAnswer: SetupDesiredProps<PollAnswer, TProps, TBehavior>

$inferredTypes.pollAnswerCount

$inferredTypes.pollAnswerCount: SetupDesiredProps<PollAnswerCount, TProps, TBehavior>

$inferredTypes.pollMedia

$inferredTypes.pollMedia: SetupDesiredProps<PollMedia, TProps, TBehavior>

$inferredTypes.pollResult

$inferredTypes.pollResult: SetupDesiredProps<PollResult, TProps, TBehavior>

$inferredTypes.role

$inferredTypes.role: SetupDesiredProps<Role, TProps, TBehavior>

$inferredTypes.scheduledEvent

$inferredTypes.scheduledEvent: SetupDesiredProps<ScheduledEvent, TProps, TBehavior>

$inferredTypes.scheduledEventRecurrenceRule

$inferredTypes.scheduledEventRecurrenceRule: SetupDesiredProps<ScheduledEventRecurrenceRule, TProps, TBehavior>

$inferredTypes.sku

$inferredTypes.sku: SetupDesiredProps<Sku, TProps, TBehavior>

$inferredTypes.soundboardSound

$inferredTypes.soundboardSound: SetupDesiredProps<SoundboardSound, TProps, TBehavior>

$inferredTypes.stageInstance

$inferredTypes.stageInstance: SetupDesiredProps<StageInstance, TProps, TBehavior>

$inferredTypes.sticker

$inferredTypes.sticker: SetupDesiredProps<Sticker, TProps, TBehavior>

$inferredTypes.subscription

$inferredTypes.subscription: SetupDesiredProps<Subscription, TProps, TBehavior>

$inferredTypes.user

$inferredTypes.user: SetupDesiredProps<User, TProps, TBehavior>

$inferredTypes.voiceState

$inferredTypes.voiceState: SetupDesiredProps<VoiceState, TProps, TBehavior>

$inferredTypes.webhook

$inferredTypes.webhook: SetupDesiredProps<Webhook, TProps, TBehavior>

Defined in

packages/bot/src/bot.ts:159