Skip to content

Commit 4126cba

Browse files
committed
discord.js v14 implementation
1 parent ff0e350 commit 4126cba

30 files changed

+527
-309
lines changed

commands/8.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { SlashCommandBuilder } = require("@discordjs/builders");
1+
const { SlashCommandBuilder } = require("discord.js");
22
const wait = require("node:timers/promises").setTimeout;
33

44
module.exports = {
@@ -45,7 +45,7 @@ module.exports = {
4545
await interaction.editReply({
4646
embeds: [
4747
{
48-
color: "RANDOM",
48+
color: 0x0ccab6,
4949
title: "**The Legendary 8 Ball**",
5050
description: "This smart ball has something to tell you.",
5151
fields: [

commands/about.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { SlashCommandBuilder } = require("@discordjs/builders");
1+
const { SlashCommandBuilder } = require("discord.js");
22

33
module.exports = {
44
data: new SlashCommandBuilder()
@@ -10,7 +10,7 @@ module.exports = {
1010
interaction.reply({
1111
embeds: [
1212
{
13-
color: "RANDOM",
13+
color: 0x0ccab6,
1414
title: "**About This Bot**",
1515
description: "The information about this bot!",
1616
thumbnail: {
@@ -19,7 +19,7 @@ module.exports = {
1919
fields: [
2020
{
2121
name: "Bot Version",
22-
value: "hackerman14 (Stable)",
22+
value: "hackerman14 (Beta)",
2323
},
2424
{
2525
name: "Bot Since",
@@ -44,7 +44,7 @@ module.exports = {
4444
},
4545
{
4646
name: "Library",
47-
value: "[Discord.js](https://discord.js.org/) (v13.7.0)",
47+
value: "[Discord.js](https://discord.js.org/)",
4848
},
4949
],
5050
timestamp: new Date(),

commands/ban.js

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
const { SlashCommandBuilder } = require("discord.js");
2+
const { PermissionFlagsBits } = require("discord.js");
3+
const wait = require("node:timers/promises").setTimeout;
4+
5+
module.exports = {
6+
data: new SlashCommandBuilder()
7+
.setName("ban")
8+
.setDescription("Fake bans people!")
9+
.setDefaultMemberPermissions(PermissionFlagsBits.BanMembers)
10+
.addUserOption((option) =>
11+
option
12+
.setName("user")
13+
.setDescription("The user you want to ban")
14+
.setRequired(true)
15+
)
16+
.addStringOption((option) =>
17+
option
18+
.setName("reason")
19+
.setDescription("Reason why you are banning the user")
20+
.setRequired(true)
21+
),
22+
async execute(interaction) {
23+
const { guild } = interaction;
24+
let user = await interaction.options.getUser("user");
25+
let reason = interaction.options.getString("reason");
26+
await interaction.reply({
27+
embeds: [
28+
{
29+
color: 0x43b582,
30+
description: `<:botSuccess:956980119086465124> ***${user.tag} was banned*** | ${reason}`,
31+
},
32+
],
33+
});
34+
await user.send({
35+
embeds: [
36+
{
37+
color: 0xf04a47,
38+
description: `You were banned from ${guild.name} | ${reason}`,
39+
},
40+
],
41+
});
42+
wait(5000);
43+
await user.send({
44+
embeds: [
45+
{
46+
color: 0xf04a47,
47+
description: `Just kidding, this isn't an actual ban.`,
48+
},
49+
],
50+
});
51+
52+
if (guild.id === "633535718559580179") {
53+
let member = await interaction.options.getMember("user");
54+
let role = await guild.roles.fetch("964481713269002251");
55+
if (user.nickname === null) {
56+
await member.roles.add(role);
57+
await wait(5000);
58+
await member.roles.remove(role);
59+
}
60+
if (user.nickname !== null) {
61+
let originalNickname = member.nickname;
62+
await member.setNickname("");
63+
await member.roles.add(role);
64+
await wait(5000);
65+
await member.roles.remove(role);
66+
await member.setNickname(originalNickname);
67+
}
68+
}
69+
},
70+
};

commands/changelog.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { SlashCommandBuilder } = require("@discordjs/builders");
1+
const { SlashCommandBuilder } = require("discord.js");
22

33
module.exports = {
44
data: new SlashCommandBuilder()
@@ -10,15 +10,15 @@ module.exports = {
1010
await interaction.reply({
1111
embeds: [
1212
{
13-
color: "RANDOM",
13+
color: 0x0ccab6,
1414
title: "**Bot Changelog**",
15-
description: "Date: May 25, 2022",
15+
description: "Date: July 20, 2022",
1616
timestamp: new Date(),
1717
fields: [
1818
{
19-
name: "New commands",
19+
name: "discord.js v14!",
2020
value:
21-
"Added `/selfpunish` and `/fuckoff` for fun (`/fuckoff` is only available for users who can kick members)",
21+
"Implenmented the new discord.js v14!",
2222
},
2323
{
2424
name: "Command enhancements",
@@ -34,15 +34,15 @@ module.exports = {
3434
await interaction.followUp({
3535
embeds: [
3636
{
37-
color: "RANDOM",
37+
color: 0x0ccab6,
3838
title: "**Previous Bot Changelog**",
39-
description: "Date: March 28, 2022",
39+
description: "Date: May 21, 2022",
4040
timestamp: new Date(),
4141
fields: [
4242
{
4343
name: "New command",
4444
value:
45-
"Added `/hack` command (it's just a Dank Memer `hack` command but I made it better)",
45+
"Added `/selfpunish` command to punish yourself!",
4646
},
4747
{
4848
name: "Command enhancements",

commands/covid.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const fetch = require("node-fetch");
2-
const { SlashCommandBuilder } = require("@discordjs/builders");
2+
const { SlashCommandBuilder } = require("discord.js");
33

44
module.exports = {
55
data: new SlashCommandBuilder()
@@ -14,7 +14,7 @@ module.exports = {
1414
interaction.reply({
1515
embeds: [
1616
{
17-
color: "RANDOM",
17+
color: 0x0ccab6,
1818
title: "**COVID-19 Information**",
1919
description: "Here's the summary details!",
2020
fields: [

commands/discordtips.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { SlashCommandBuilder } = require("@discordjs/builders");
1+
const { SlashCommandBuilder } = require("discord.js");
22

33
module.exports = {
44
data: new SlashCommandBuilder()
@@ -41,7 +41,7 @@ module.exports = {
4141
interaction.reply({
4242
embeds: [
4343
{
44-
color: "RANDOM",
44+
color: 0x0ccab6,
4545
title: "**Discord Tips**",
4646
description: randomTip,
4747
timestamp: new Date(),

commands/example.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { SlashCommandBuilder } = require("@discordjs/builders");
1+
const { SlashCommandBuilder } = require("discord.js");
22

33
module.exports = {
44
data: new SlashCommandBuilder()

commands/fact.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const fetch = require("node-fetch");
2-
const { SlashCommandBuilder } = require("@discordjs/builders");
2+
const { SlashCommandBuilder } = require("discord.js");
33

44
module.exports = {
55
data: new SlashCommandBuilder()
@@ -14,7 +14,7 @@ module.exports = {
1414
interaction.reply({
1515
embeds: [
1616
{
17-
color: "RANDOM",
17+
color: 0x0ccab6,
1818
title: "**Boring Facts**",
1919
description: body.data,
2020
timestamp: new Date(),

commands/feedback.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const {
44
Modal,
55
TextInputComponent,
66
} = require("discord.js");
7-
const { SlashCommandBuilder } = require("@discordjs/builders");
7+
const { SlashCommandBuilder } = require("discord.js");
88

99
module.exports = {
1010
data: new SlashCommandBuilder()

commands/fuckoff.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
const { MessageActionRow, MessageButton } = require("discord.js");
2-
const { SlashCommandBuilder } = require("@discordjs/builders");
1+
const { ActionRowBuilder, ButtonBuilder } = require("discord.js");
2+
const { SlashCommandBuilder } = require("discord.js");
33

44
module.exports = {
55
data: new SlashCommandBuilder()
@@ -8,8 +8,8 @@ module.exports = {
88
async execute(interaction) {
99
const { client, guild } = interaction;
1010
const botOwner = client.users.cache.get("410839910204047360").tag;
11-
const cancelAction = new MessageActionRow().addComponents(
12-
new MessageButton()
11+
const cancelAction = new ActionRowBuilder().addComponents(
12+
new ButtonBuilder()
1313
.setCustomId("cancel")
1414
.setLabel("Cancel")
1515
.setStyle("DANGER")
@@ -32,7 +32,7 @@ module.exports = {
3232
await interaction.reply({
3333
embeds: [
3434
{
35-
color: "RANDOM",
35+
color: 0x0ccab6,
3636
title: "**You Hate Me™**",
3737
description:
3838
"Sorry to see you go, the bot will leave within 60 seconds after executing the command.\n**To cancel the action, click on the button below.**",
@@ -55,7 +55,7 @@ module.exports = {
5555
await i.update({
5656
embeds: [
5757
{
58-
color: "RANDOM",
58+
color: 0x0ccab6,
5959
title: "**You Hate Me™**",
6060
description: "Action cancelled!",
6161
timestamp: new Date(),
@@ -77,7 +77,7 @@ module.exports = {
7777
interaction.editReply({
7878
embeds: [
7979
{
80-
color: "RANDOM",
80+
color: 0x0ccab6,
8181
title: "**You Hate Me™**",
8282
description:
8383
"Thank you for using hackerman14 bot, have a nice day!",

0 commit comments

Comments
 (0)