- Make sure you have nodejs installed.
- yarn
npm install -g yarn
- Clone the repo
git clone https://github.com/your_username_/Project-Name.git
- Install packages
yarn
- Rename
env.example
to.env
- Enter your TOKEN, PREFIX, GUILDID, CLIENTID in
.env
TOKEN=your bot token PREFIX= GUILDID=your guild id CLIENTID=your client id
- Build
yarn start:build
- Start
yarn start
import { SlashCommandBuilder } from "@discordjs/builders";
import { CommandInteraction } from "discord.js";
import { Bot } from "src/Client";
import { Command } from "../Loaders/Command";
export default class Ping extends Command {
constructor() {
super({
data: new SlashCommandBuilder().setName('ping').setDescription('Send websockets ping in ms')
})
}
public async run(bot: Bot, interaction: CommandInteraction, ...args: any[]): Promise<void> {
interaction.reply({ content: `Pong! ${bot.ws.ping}`, ephemeral: false })
}
}
import { Event } from "../Loaders/event";
import { Bot } from "../Client";
import { GUILDID } from "../Config";
export default class Ready extends Event {
constructor() {
super({ name: 'ready' })
}
public async run(bot: Bot): Promise<void> {
console.log(`Logged in as ${bot.user?.tag}`)
}
}
Discord - Izzat#0333