0.0.13 • Published 2 years ago

@foealke/discordbotframework v0.0.13

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Framework docs

npm install @foealke/discordbotframework
// file: bot.js 
const BotFamework = require("@foealke/discordbotframework")

const bot = new BotFamework.Bot(
    null,   // devToken (string)
    null,   // devServerId (string)
    null,   // devAppId (string)
    null,   // prodToken (string)
    null,   // prodAppId (string)
    [],     // intents (List<Discord.js Intents>)
)

bot.useCommands(__dirname + "/commands")
bot.useEvents(__dirname + "/events")

bot.login( devMode=true )
// file: commands/ping.command.js 
const { SlashCommandBuilder } = require('@discordjs/builders');

const COMMAND_NAME = "ping"
const COMMAND_DESCRIPTION = "ping pong!"

module.exports = {
    COMMAND_NAME, COMMAND_DESCRIPTION,
    commandInteractionHandler: ( interaction ) => {
        interaction.reply({ message: "Pong!" })      
    },

    command: new SlashCommandBuilder()
        .setName(COMMAND_NAME)
        .setDescription(COMMAND_DESCRIPTION)
}
// file: events/ready.event.js 
module.exports = (client) => {

    client.on("ready", () => {
        console.log("bot started!")
    })
    
}
0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.8

2 years ago

0.0.5

2 years ago

0.0.2-g

2 years ago

0.0.2-f

2 years ago

0.0.2-e

2 years ago

0.0.2-d

2 years ago

0.0.2-c

2 years ago

0.0.2-b

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago