mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-02 08:50:07 +00:00
Merge branch 'main' of https://github.com/discordeno/discordeno into main
This commit is contained in:
10
bot.ts
10
bot.ts
@@ -140,7 +140,7 @@ import { transformComponentToDiscordComponent } from "./transformers/reverse/com
|
||||
import { getBotIdFromToken, removeTokenPrefix } from "./util/token.ts";
|
||||
import { CreateShardManager } from "./gateway/manager/shardManager.ts";
|
||||
|
||||
export async function createBot(options: CreateBotOptions): Promise<Bot> {
|
||||
export function createBot(options: CreateBotOptions): Bot {
|
||||
const bot = {
|
||||
id: options.botId ?? getBotIdFromToken(options.token),
|
||||
applicationId: options.applicationId || options.botId,
|
||||
@@ -168,7 +168,7 @@ export async function createBot(options: CreateBotOptions): Promise<Bot> {
|
||||
|
||||
bot.helpers = createHelpers(bot, options.helpers ?? {});
|
||||
bot.gateway = createGatewayManager({
|
||||
gatewayBot: bot.botGatewayData ?? await bot.helpers.getGatewayBot(),
|
||||
gatewayBot: bot.botGatewayData ?? {} as any,
|
||||
gatewayConfig: {
|
||||
token: options.token,
|
||||
intents: options.intents,
|
||||
@@ -259,7 +259,11 @@ export function createEventHandlers(
|
||||
};
|
||||
}
|
||||
|
||||
export function startBot(bot: Bot) {
|
||||
export async function startBot(bot: Bot) {
|
||||
if (!bot.botGatewayData) {
|
||||
bot.gateway.gatewayBot = await bot.helpers.getGatewayBot();
|
||||
}
|
||||
|
||||
bot.gateway.spawnShards();
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ export const GATEWAY_VERSION = 10;
|
||||
|
||||
// TODO: update this version
|
||||
/** https://github.com/discordeno/discordeno/releases */
|
||||
export const DISCORDENO_VERSION = "13.0.0-rc42";
|
||||
export const DISCORDENO_VERSION = "13.0.0-rc43";
|
||||
|
||||
/** https://discord.com/developers/docs/reference#user-agent */
|
||||
export const USER_AGENT = `DiscordBot (https://github.com/discordeno/discordeno, v${DISCORDENO_VERSION})`;
|
||||
|
||||
Reference in New Issue
Block a user