Discord.js v13でBotを作る際のテンプレート
- Botを
applications.commandsスコープ付きで導入 BOT_TOKENという環境変数にBotのTOKENを入れるnpx node register.js コマンドを使うサーバーIDを実行npx node index.jsでBot実行
使い方 3.のサーバーIDはGuildCommandとして設定するためのものです。GlobalCommandとして登録する場合は空欄にしてください。
The template for Version13 Discord.js Bot With EvalCommand and SlashCommand :)
- Invite your BotClient to your any guilds with
Botandapplication.commandspermissions. - Insert the Token to
BOT_TOKENenviroment variables. - Run
npx node register.js GuildIDin shell. - Run
npx node index.jsin shell.
The "GuildID" of Step3 value is for setting up GuildCommand. Please put it blank when you want setup GlobalCommand.