Skip to content

Commit 80484f8

Browse files
committed
🔨 chore: update discord-bot example
1 parent 2c5321c commit 80484f8

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

examples/discord-bot/bot.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
const { Client, Intents } = require("discord.js");
1+
const { Client, IntentsBitField, ApplicationCommandOptionType } = require("discord.js");
22
const { PasteClient, Publicity, ExpireDate } = require("pastebin-api");
33

4-
const bot = new Client({ intents: [Intents.FLAGS.GUILDS] });
4+
const bot = new Client({ intents: [IntentsBitField.Flags.Guilds] });
55
const pasteClient = new PasteClient("DEV_API_KEY");
66

77
bot.on("interactionCreate", async (interaction) => {
@@ -33,16 +33,16 @@ bot.on("ready", async () => {
3333
name: "code",
3434
required: true,
3535
description: "This will be the paste code",
36-
type: "STRING",
36+
type: ApplicationCommandOptionType.String,
3737
},
3838
{
3939
name: "name",
4040
required: false,
4141
description: "This will be the name of the paste",
42-
type: "STRING",
42+
type: ApplicationCommandOptionType.String,
4343
},
4444
{
45-
type: "STRING",
45+
type: ApplicationCommandOptionType.String,
4646
name: "expire-date",
4747
required: false,
4848
description: "When the paste will expire",
@@ -89,4 +89,4 @@ bot.on("ready", async () => {
8989
console.log("Bot is ready!");
9090
});
9191

92-
bot.login("BOT_TOKEN");
92+
bot.login("NzMwMzk0NTQwNjE5MzMzNzEy.GdwEWQ.67SPQDKUO2fFF_IF_mL1E_vrH6m2vhXFp_yawQ");

examples/discord-bot/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"start": "node bot.js"
88
},
99
"dependencies": {
10-
"discord.js": "^13.6.0",
11-
"pastebin-api": "^4.0.0"
10+
"discord.js": "^14.1.2",
11+
"pastebin-api": "latest"
1212
}
1313
}

0 commit comments

Comments
 (0)