Files
discordeno/plugins/fileloader
ITOH d7883855ec refactor(.github,README,gateway,plugins/fileloader,tests,types)!: make intent calculation manual
This changes the calculation of intents to be manual to the dev.
This is to improve overall consistency of our code base, also it is not a big drawback for users since intents are usually done once and then never (seldom) touched again.
2022-05-24 23:16:01 +02:00
..
2022-01-26 19:02:34 +01:00
2022-02-04 15:00:04 +01:00

fileloader-plugin

This plugin leverages the ability to write files, and then import them.

Code Example

import { createBot, enableFileLoaderPlugin, Intents, startBot } from "./deps.ts"; // Import discordeno and this plugin.

console.log("Starting Up the Bot, this might take awhile...");

const bot = enableFileLoaderPlugin(
  createBot({
    token: "", // Your bot's token
    botId: 0n, // Your bot's "Application Id",
    intents: Intents.Guilds,
    events: {
      ready() {
        console.log("Bot Ready");
      },
    },
  }),
);

bot.fastFileLoader([
  // './src/commands', etc. This works just like `import [something] from [somewhere]`
]);

startBot(bot);

Make sure to ignore fileloader.ts in git as it is (re)generated where you (re)start the bot.