Skip to content

Commit

Permalink
updated to discord.js v14 and fixed bugs πŸ”₯❀️‍πŸ”₯
Browse files Browse the repository at this point in the history
updated to discord.js v14 and fixed bugs πŸ”₯❀️‍πŸ”₯
  • Loading branch information
kabirjaipal authored Jan 12, 2023
1 parent 707d30a commit 7e3972b
Show file tree
Hide file tree
Showing 15 changed files with 392 additions and 183 deletions.
41 changes: 41 additions & 0 deletions Commands/Message/Misc/avatar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
const {
Message,
PermissionFlagsBits,
Client,
EmbedBuilder,
} = require("discord.js");

module.exports = {
name: "avatar",
description: "Get Avar Of a User !!",
userPermissions: PermissionFlagsBits.SendMessages,
botPermissions: PermissionFlagsBits.SendMessages,
category: "Misc",
cooldown: 5,
/**
*
* @param {Client} client
* @param {Message} message
* @param {String[]} args
* @param {String} prefix
*/
run: async (client, message, args, prefix) => {
// Code
let AvatarUrl = message.author.displayAvatarURL({
extension: "png",
size: 512,
});
message.reply({
embeds: [
new EmbedBuilder()
.setColor("Blurple")
.setAuthor({
name: `Avatar Of ${message.author.tag}`,
iconURL: AvatarUrl,
})
.setImage(AvatarUrl)
.setTimestamp(),
],
});
},
};
23 changes: 23 additions & 0 deletions Commands/Message/Misc/ping.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const { Message, PermissionFlagsBits, Client } = require("discord.js");

module.exports = {
name: "ping",
description: "Get Bot Real Ping !!",
userPermissions: PermissionFlagsBits.SendMessages,
botPermissions: PermissionFlagsBits.SendMessages,
category: "Misc",
cooldown: 5,
/**
*
* @param {Client} client
* @param {Message} message
* @param {String[]} args
* @param {String} prefix
*/
run: async (client, message, args, prefix) => {
// Code
message.reply({
content: `> Pong \`${client.ws.ping}\``,
});
},
};
41 changes: 41 additions & 0 deletions Commands/Slash/Misc/avatar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
const {
CommandInteraction,
ApplicationCommandType,
PermissionFlagsBits,
Client,
EmbedBuilder,
} = require("discord.js");

module.exports = {
name: "avatar",
description: `Get Avatar of a User !!`,
userPermissions: PermissionFlagsBits.SendMessages,
botPermissions: PermissionFlagsBits.SendMessages,
category: "Misc",
type: ApplicationCommandType.ChatInput,
/**
*
* @param {Client} client
* @param {CommandInteraction} interaction
*/
run: async (client, interaction) => {
// Code
let AvatarUrl = interaction.user.displayAvatarURL({
extension: "png",
size: 512,
});
interaction.reply({
embeds: [
new EmbedBuilder()
.setColor("Blurple")
.setAuthor({
name: `Avatar Of ${interaction.user.tag}`,
iconURL: AvatarUrl,
})
.setImage(AvatarUrl)
.setTimestamp(),
],
ephemeral: true,
});
},
};
27 changes: 27 additions & 0 deletions Commands/Slash/Misc/ping.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const {
CommandInteraction,
ApplicationCommandType,
PermissionFlagsBits,
Client,
} = require("discord.js");

module.exports = {
name: "ping",
description: `Get Bot Real Ping !!`,
userPermissions: PermissionFlagsBits.SendMessages,
botPermissions: PermissionFlagsBits.SendMessages,
category: "Misc",
type: ApplicationCommandType.ChatInput,
/**
*
* @param {Client} client
* @param {CommandInteraction} interaction
*/
run: async (client, interaction) => {
// Code
interaction.reply({
content: `> Pong \`${client.ws.ping}\``,
ephemeral: true,
});
},
};
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 α΄‹α΄€Κ™ΙͺΚ€γ€…κœ±Ιͺɴɒʜ
Copyright (c) 2022 α΄‹α΄€Κ™ΙͺΚ€γ€…κœ±Ιͺɴɒʜ

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
141 changes: 8 additions & 133 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
# Hi, I'm Kabir! πŸ‘‹

I'm a Discord Bot Developer and here is mine bot handler

# Discord.JS V14 Handler

a discord.js handler which support slash commands , message commands , events and more...
<h1 align="center">
Discord Bot Using JavaScript Discord.JS </h1><br/>

## **Installation | How to use the Bot**

Expand All @@ -14,138 +9,18 @@ a discord.js handler which support slash commands , message commands , events an

**3.** Fill in everything in **`settings/config.js`**

**4.** after Fill everything in config Type in shall **`npm install`**

**5.** start the bot with **`node index.js`**
**4.** start the bot with **`node index.js`**
<br/>

### _Modify - config.js_

```javascript
{
token: "BOT_TOKEN"
prefix: "BOT_PREFIX",
}
```

## Handler Features

- easy to use Handler
- support event Handler
- slash commands support
- message commands support
- based on [discord.js](https://discord.js.org/#/)
- provied code snipet for commands
- support sub directory in commands folder
- support code suggestions in Handler

## Feedback

If you have any feedback, please reach out to us at [Discord Server](https://discord.gg/PcUVWApWN3)

## Usage/Examples

- Commands Example

```javascript
// chat input slash commands
const {
CommandInteraction,
ApplicationCommandType,
PermissionFlagsBits,
} = require("discord.js");
const BOT = require("../../../handlers/Client");

module.exports = {
name: "",
description: ``,
userPermissions: PermissionFlagsBits.SendMessages,
botPermissions: PermissionFlagsBits.SendMessages,
category: "",
cooldown: 10,
type: ApplicationCommandType.ChatInput,
/**
*
* @param {BOT} client
* @param {CommandInteraction} interaction
* @param {String[]} args
*/
run: async (client, interaction, args) => {
// Code
},
};

// message input slash commands
const { Message, PermissionFlagsBits } = require("discord.js");
const BOT = require("../../../handlers/Client");

module.exports = {
name: "",
description: ``,
userPermissions: PermissionFlagsBits.SendMessages,
botPermissions: PermissionFlagsBits.SendMessages,
category: "",
cooldown: 10,
/**
*
* @param {BOT} client
* @param {Message} message
* @param {String[]} args
* @param {String} prefix
*/
run: async (client, message, args, prefix) => {
// Code
},
};

// user slash commands

const {
ContextMenuCommandInteraction,
ApplicationCommandType,
} = require("discord.js");
const BOT = require("../../../handlers/Client");

module.exports = {
name: "",
category: "",
type: ApplicationCommandType.User,
/**
*
* @param {BOT} client
* @param {ContextMenuCommandInteraction} interaction
*/
run: async (client, interaction) => {
// Code
},
};

// message commands
const { Message } = require("discord.js");
const BOT = require("../../../handlers/Client");

module.exports = {
name: "",
description: ``,
userPermissions: [],
botPermissions: [],
category: "",
cooldown: 10,
/**
*
* @param {BOT} client
* @param {Message} message
* @param {String[]} args
* @param {String} prefix
*/
run: async (client, message, args, prefix) => {
// Code
},
};
TOKEN : process.env.TOKEN || "BOT_TOKEN",
PREFIX : process.env.PREFIX || "BOT_PREFIX"
}
```

## License

[MIT](https://choosealicense.com/licenses/mit/)
<br/>

# Thanks For Using Mine Handler Please Give a Star
If Any Bug Open Pull Request
21 changes: 9 additions & 12 deletions command_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,22 @@ const {
CommandInteraction,
ApplicationCommandType,
PermissionFlagsBits,
Client,
} = require("discord.js");
const BOT = require("../../../handlers/Client");

module.exports = {
name: "",
description: ``,
userPermissions: PermissionFlagsBits.SendMessages,
botPermissions: PermissionFlagsBits.SendMessages,
category: "",
cooldown: 10,
type: ApplicationCommandType.ChatInput,
/**
*
* @param {BOT} client
* @param {Client} client
* @param {CommandInteraction} interaction
* @param {String[]} args
*/
run: async (client, interaction, args) => {
run: async (client, interaction) => {
// Code
},
};
Expand All @@ -29,16 +27,16 @@ module.exports = {
const {
ContextMenuCommandInteraction,
ApplicationCommandType,
Client,
} = require("discord.js");
const BOT = require("../../../handlers/Client");

module.exports = {
name: "",
category: "",
type: ApplicationCommandType.Message,
/**
*
* @param {BOT} client
* @param {Client} client
* @param {ContextMenuCommandInteraction} interaction
*/
run: async (client, interaction) => {
Expand All @@ -51,16 +49,16 @@ module.exports = {
const {
ContextMenuCommandInteraction,
ApplicationCommandType,
Client,
} = require("discord.js");
const BOT = require("../../../handlers/Client");

module.exports = {
name: "",
category: "",
type: ApplicationCommandType.User,
/**
*
* @param {BOT} client
* @param {Client} client
* @param {ContextMenuCommandInteraction} interaction
*/
run: async (client, interaction) => {
Expand All @@ -69,8 +67,7 @@ module.exports = {
};

// message commands
const { Message, PermissionFlagsBits } = require("discord.js");
const BOT = require("../../../handlers/Client");
const { Message, PermissionFlagsBits, Client } = require("discord.js");

module.exports = {
name: "",
Expand All @@ -81,7 +78,7 @@ module.exports = {
cooldown: 10,
/**
*
* @param {BOT} client
* @param {Client} client
* @param {Message} message
* @param {String[]} args
* @param {String} prefix
Expand Down
Loading

0 comments on commit 7e3972b

Please sign in to comment.