From b5105cbc32ce1d62c6c56b478b9fd0dff82d2fb6 Mon Sep 17 00:00:00 2001 From: meister03 <69507874+meister03@users.noreply.github.com> Date: Tue, 23 Aug 2022 16:30:54 +0200 Subject: [PATCH] Fix beginner template (#2315) * Fix beginner template * deno fmt * deno fmt Co-authored-by: meister03 Co-authored-by: LTS20050703 <87189679+lts20050703@users.noreply.github.com> Co-authored-by: LTS20050703 --- template/beginner/.env.example | 4 ++-- template/beginner/bot.ts | 3 ++- template/beginner/configs.ts | 2 +- template/beginner/deps.ts | 4 ++-- template/beginner/src/events/ready.ts | 4 ++-- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/template/beginner/.env.example b/template/beginner/.env.example index 1aa98658c..7acf6fd79 100644 --- a/template/beginner/.env.example +++ b/template/beginner/.env.example @@ -1,2 +1,2 @@ -BOT_TOKEN= -DEV_GUILD_ID= \ No newline at end of file +BOT_TOKEN='' +DEV_GUILD_ID='' \ No newline at end of file diff --git a/template/beginner/bot.ts b/template/beginner/bot.ts index 1189e743f..8665ab702 100644 --- a/template/beginner/bot.ts +++ b/template/beginner/bot.ts @@ -8,6 +8,7 @@ import { enableCacheSweepers, enableHelpersPlugin, enablePermissionsPlugin, + GatewayIntents, } from "./deps.ts"; import { Command } from "./src/types/commands.ts"; @@ -15,7 +16,7 @@ import { Command } from "./src/types/commands.ts"; const bot = createBot({ token: configs.token, botId: configs.botId, - intents: [], + intents: GatewayIntents.Guilds, events: {}, }); diff --git a/template/beginner/configs.ts b/template/beginner/configs.ts index 7119cd627..b9ce9098d 100644 --- a/template/beginner/configs.ts +++ b/template/beginner/configs.ts @@ -1,7 +1,7 @@ import { dotEnvConfig } from "./deps.ts"; // Get the .env file that the user should have created, and get the token -const env = dotEnvConfig({ export: true }); +const env = dotEnvConfig({ export: true, path: "./.env.example" }); const token = env.BOT_TOKEN || ""; export interface Config { diff --git a/template/beginner/deps.ts b/template/beginner/deps.ts index 5b26ceea2..3ac57d150 100644 --- a/template/beginner/deps.ts +++ b/template/beginner/deps.ts @@ -1,5 +1,5 @@ -export * from "https://deno.land/x/discordeno@13.0.0-rc31/mod.ts"; -export * from "https://deno.land/x/discordeno@13.0.0-rc31/plugins/mod.ts"; +export * from "https://deno.land/x/discordeno@13.0.0-rc45/mod.ts"; +export * from "https://deno.land/x/discordeno@13.0.0-rc45/plugins/mod.ts"; // Terminal Colors! export * from "https://deno.land/std@0.117.0/fmt/colors.ts"; diff --git a/template/beginner/src/events/ready.ts b/template/beginner/src/events/ready.ts index ba58936e6..df429f2ee 100644 --- a/template/beginner/src/events/ready.ts +++ b/template/beginner/src/events/ready.ts @@ -2,9 +2,9 @@ import { Bot } from "../../bot.ts"; import log from "../utils/logger.ts"; Bot.events.ready = (_, payload) => { - log.info(`[READY] Shard ID ${payload.shardId} of ${Bot.gateway.maxShards} shards is ready!`); + log.info(`[READY] Shard ID ${payload.shardId} of ${Bot.gateway.lastShardId} shards is ready!`); - if (payload.shardId + 1 === Bot.gateway.maxShards) { + if (payload.shardId === Bot.gateway.lastShardId) { botFullyReady(); } };