Fix beginner template (#2315)

* Fix beginner template

* deno fmt

* deno fmt

Co-authored-by: meister03 <meisterpi@gmail.com>
Co-authored-by: LTS20050703 <87189679+lts20050703@users.noreply.github.com>
Co-authored-by: LTS20050703 <lts20050703@gmail.com>
This commit is contained in:
meister03
2022-08-23 16:30:54 +02:00
committed by GitHub
parent 0fb4e1f398
commit b5105cbc32
5 changed files with 9 additions and 8 deletions

View File

@@ -1,2 +1,2 @@
BOT_TOKEN=
DEV_GUILD_ID=
BOT_TOKEN=''
DEV_GUILD_ID=''

View File

@@ -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: {},
});

View File

@@ -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 {

View File

@@ -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";

View File

@@ -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();
}
};