fix: beginner template

This commit is contained in:
Skillz4Killz
2022-03-25 10:58:39 +00:00
committed by GitHub
parent 9a539ba17f
commit 176d3c0ba7
4 changed files with 25 additions and 9 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
# Allows quick testing of changes and keeps stuff like tokens private # Allows quick testing of changes and keeps stuff like tokens private
debug.ts debug.ts
configs.ts ./configs.ts
.env .env
# npm stuff # npm stuff
+19
View File
@@ -0,0 +1,19 @@
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 token = env.BOT_TOKEN || "";
export interface Config {
token: string;
botId: bigint;
}
export const configs = {
/** Get token from ENV variable */
token,
/** Get the BotId from the token */
botId: BigInt(atob(token.split(".")[0])),
/** The server id where you develop your bot and want dev commands created. */
devGuildId: BigInt(env.DEV_GUILD_ID!),
};
+3 -6
View File
@@ -1,12 +1,9 @@
export * from "https://deno.land/x/discordeno@13.0.0-rc18/mod.ts"; export * from "https://deno.land/x/discordeno@13.0.0-rc27/mod.ts";
export * from "https://deno.land/x/discordeno@13.0.0-rc27/plugins/mod.ts";
// Terminal Colors! // Terminal Colors!
export * from "https://deno.land/std@0.117.0/fmt/colors.ts"; export * from "https://deno.land/std@0.117.0/fmt/colors.ts";
// Get data from .env files // Get data from .env files
export { config as dotEnvConfig } from "https://deno.land/x/dotenv@v3.1.0/mod.ts"; export { config as dotEnvConfig } from "https://deno.land/x/dotenv@v3.1.0/mod.ts";
// Database, thx Tri! // Database, thx Tri!
export * from "https://deno.land/x/kwik@v1.2.1/mod.ts"; export * from "https://deno.land/x/kwik@v1.2.1/mod.ts";
// All the Plugins
export * from "https://deno.land/x/discordeno_cache_plugin@0.0.21/mod.ts";
export * from "https://deno.land/x/discordeno_permissions_plugin@0.0.15/mod.ts";
export * from "https://deno.land/x/discordeno_helpers_plugin@0.0.8/mod.ts";
+2 -2
View File
@@ -1,5 +1,5 @@
import { BotClient } from "../../bot.ts"; import { BotClient } from "../../bot.ts";
import { ApplicationCommandOption, ApplicationCommandTypes, DiscordenoInteraction } from "../../deps.ts"; import { ApplicationCommandOption, ApplicationCommandTypes, Interaction } from "../../deps.ts";
export interface Command { export interface Command {
/** The name of this command. */ /** The name of this command. */
@@ -13,5 +13,5 @@ export interface Command {
/** The options for this command */ /** The options for this command */
options?: ApplicationCommandOption[]; options?: ApplicationCommandOption[];
/** This will be executed when the command is run. */ /** This will be executed when the command is run. */
execute: (bot: BotClient, interaction: DiscordenoInteraction) => unknown; execute: (bot: BotClient, interaction: Interaction) => unknown;
} }