Skip to content

Commit bb89826

Browse files
authored
Merge pull request #34 from MDCYT/dev
Dev
2 parents d8cf96c + f4f9a95 commit bb89826

155 files changed

Lines changed: 1673 additions & 1212 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env-example

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
TOKEN=Your_Bot_Token
22
GUILD_ID=Your_Guild_Id
3-
ENV=production #This will define if the slash commands are put or not
3+
ENV=production #This will define if the slash commands are put or not
4+
MONGODB_URL=Your_MongoDB_URL

config-example.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@
99
"feedbackChannelId": "Your_Feedback_Channel_Id",
1010
"serverLogId": "Your_Server_Log_Channel_Id",
1111
"supportServerInvite": "Your_Support_Server_Invite",
12-
"mongodb_url": "Your_MongoDB_Url",
1312
"botStats": {
14-
"guilds_channel": "Your_Guilds_Channel_Stats_Bot",
15-
"users_channel": "Your_Users_Channel_Stats_Bot"
13+
"guilds_channel": "Your_Guilds_Channel_Stats_Bot"
1614
},
15+
"apiUrl": "https://api.any-bot.tech/api/v1",
1716
"apiKeys": {
1817
"catApi": "Cat_Api_Key",
1918
"googleApi": "Google_Api_Key",
@@ -27,7 +26,8 @@
2726
"nasaapi": "Nasa_Api_Key",
2827
"uberduckapi_key": "UberDuck_Api_Key",
2928
"uberduckapi_secret": "UberDuck_Api_Secret",
30-
"osuapikey": "Osu_Api_Key"
29+
"osuapikey": "Osu_Api_Key",
30+
"customAPIKey": "Your_Custom_Api_Key_For_Any_API"
3131
},
3232
"botlist": false
33-
}
33+
}

src/buttons/Button.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
const { MessageEmbed } = require("discord.js");
2-
31
/**
42
* Any Bot's custom Button class
53
*/

src/buttons/animals/dog.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
const Button = require("../Button.js");
2+
const fetch = require("node-fetch");
3+
const { MessageEmbed, MessageActionRow, MessageButton } = require("discord.js");
4+
5+
module.exports = class DogButton extends Button {
6+
constructor(client) {
7+
super(client, {
8+
name: "dog",
9+
});
10+
}
11+
12+
async run(interaction) {
13+
const res = await fetch("https://dog.ceo/api/breeds/image/random");
14+
const img = (await res.json()).message;
15+
const embed = new MessageEmbed()
16+
.setTitle("🐶 Woof! 🐶")
17+
.setImage(img)
18+
.setFooter({
19+
text: interaction.user.username,
20+
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
21+
})
22+
.setTimestamp()
23+
.setColor(
24+
interaction.guild ? interaction.guild.me.displayHexColor : "#7289DA"
25+
);
26+
27+
const row = new MessageActionRow().addComponents(
28+
new MessageButton()
29+
.setLabel("Another dog")
30+
.setStyle("PRIMARY")
31+
.setEmoji("🐶")
32+
.setCustomId("dog")
33+
);
34+
35+
interaction.update({ embeds: [embed], components: [row] });
36+
}
37+
};

src/commands/ReactionMenu.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ module.exports = class ReactionMenu {
149149
* Adds reactions to the message
150150
*/
151151
async addReactions() {
152-
for (const emoji of this.emojis) {
152+
for await (const emoji of this.emojis) {
153153
await this.message.react({ name: emoji });
154154
}
155155
}

src/commands/admin/SetAdminRole.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ module.exports = class SetAdminRoleCommand extends Command {
5656
this.getRoleFromMention(message, args[0]) ||
5757
message.guild.roles.cache.get(args[0]);
5858
if (!adminRole)
59-
return await this.sendErrorMessage(
59+
return this.sendErrorMessage(
6060
message,
6161
0,
6262
"Please mention a role or provide a valid role ID"

src/commands/admin/SetAutoBan.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module.exports = class SetAutoBanCommand extends Command {
3232
const amount = Number(args[0]);
3333
// Check if warn count is a number:
3434
if (amount && (!Number.isInteger(amount) || amount < 0))
35-
return await this.sendErrorMessage(
35+
return this.sendErrorMessage(
3636
message,
3737
0,
3838
"Please enter a positive integer"

src/commands/admin/SetAutoKick.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ module.exports = class SetAutoKickCommand extends Command {
3131
const amount = Number(args[0]);
3232
// Check if warn count is a number:
3333
if (amount && (!Number.isInteger(amount) || amount < 0))
34-
return await this.sendErrorMessage(message, 0, 'Please enter a positive integer');
34+
return this.sendErrorMessage(message, 0, 'Please enter a positive integer');
3535

3636
// Send embed:
3737
const embed = new MessageEmbed()

src/commands/admin/SetAutoRole.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ module.exports = class SetAutoRoleCommand extends Command {
4747

4848
// Update role
4949
const autoRole = this.getRoleFromMention(message, args[0]) || message.guild.roles.cache.get(args[0]);
50-
if (!autoRole) return await this.sendErrorMessage(message, 0, 'Please mention a role or provide a valid role ID');
50+
if (!autoRole) return this.sendErrorMessage(message, 0, 'Please mention a role or provide a valid role ID');
5151
await message.client.mongodb.settings.updateAutoRoleId(autoRole.id, message.guild.id);
5252
return message.channel.send({embeds: [embed.addField('Auto Role', `${oldAutoRole}${autoRole}`)]});
5353
}

src/commands/admin/SetCommandPoints.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module.exports = class SetCommandPointsCommand extends Command {
1717
async run(message, args) {
1818
const amount = args[0];
1919
if (!amount || !Number.isInteger(Number(amount)) || amount < 0)
20-
return await this.sendErrorMessage(message, 0, 'Please enter a positive integer');
20+
return this.sendErrorMessage(message, 0, 'Please enter a positive integer');
2121
const {
2222
pointTracking: pointTracking,
2323
messagePoints: messagePoints,

0 commit comments

Comments
 (0)