Skip to main content
Deno 2 is finally here 🎉️
Learn more

discord-bot-lib

A basic discord bot lib for deno but the library doesn’t cache discord objects.

Key points

  • Simple command handler.
  • NO third-party dependencies
  • Simple handler for slash commands.
  • This lib does NOT cache external discord objects.
  • This lib does NOT support voice (sorry music bots)
  • This lib gives you full control on how you cache discord data.
  • This lib gives you full control on how you handle discord gateway events.
  • Really customizable.

Example

import Bot from 'https://deno.land/x/discord_bot_lib@v1.2.8/mod.ts';

const bot: Bot = new Bot({
    token: "discord token",
    prefix: "!"
});

bot.command({
    name: "ping",
    aliases: ["pong"],
    run: async (ctx: any) => {
        await ctx.send(`pong! ${bot.ping} ms`);
    }
});

bot.addEventListener('ready', () => {
    console.log("The bot is ready to use!");
});

bot.run();