mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
fix: beginner template
This commit is contained in:
+1
-1
@@ -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
|
||||||
|
|||||||
@@ -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!),
|
||||||
|
};
|
||||||
@@ -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";
|
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user