1.0.75 • Published 2 years ago

typescript-discordjs-bot-v13 v1.0.75

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

typescript-discordjs-bot-v13

Custom bot client that allows for easy creation of / commands, buttons, menus and events using typescript classes to interact with the discord api

Setup

import { Intents } from "discord.js";
import { DiscordClient } from "../src/index";

const client = new DiscordClient({
    intents: [
        Intents.FLAGS.GUILDS,
        Intents.FLAGS.GUILD_MESSAGES
    ],
    shards: 'auto',
    failIfNotExists: false
}, {
    command_path: '../commands',
    button_path: '../buttons',
    menu_path: '../menus',
    event_path: '../events',
    create_commands: true,
    test_guild: '866606673372119091'
})

client.login('TOKEN')

Command

import { CommandInteraction, } from "discord.js";
import { Command } from "typescript-discordjs-bot-v13";

export default class extends Command {
    constructor() {
        super({
            name: "ping",
            description: "Ping, pong",
            global: true
        })
    }

    public getBuilder(data?: any) {
        const slash = this.getCommand()
        return slash
    }

    public execute(interaction: CommandInteraction): void {
        interaction.reply({ content: 'Pong' })
    }
}

Event

import { Message, WebhookClient } from 'discord.js'
import { Event } from 'typescript-discordjs-bot-v13'

export default class extends Event {
    constructor() {
        super({
            event: 'messageCreate'
        })
    }

    async execute(message: Message) {
        console.log(message.content)
    }
}
1.0.75

2 years ago

1.0.74

2 years ago

1.0.73

2 years ago

1.0.72

2 years ago

1.0.71

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago