Skip to content

Commit fdb8cb6

Browse files
Fix some bugs
1 parent bbd7471 commit fdb8cb6

File tree

17 files changed

+389
-384
lines changed

17 files changed

+389
-384
lines changed

bot.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ that makes voting work
6060
| | | | | | | | | | Custom Functions | | | | | | | | | | | |
6161
*/ /////////////////////////////////////////////////////////////
6262

63-
6463
/*/////////////////////////////////////////////////////////////////////////////////////////////////////////////
6564
This is
6665
(supposed to be) the command parser
@@ -86,7 +85,6 @@ const distube = new DisTube(client, {
8685
plugins: [new SpotifyPlugin(), new SoundCloudPlugin()],
8786
});
8887
client.distube = distube;
89-
client.premium_distube = client.distube;
9088
// noinspection JSUnresolvedVariable
9189
client.on("voiceStateUpdate", async (oldState, newState) => {
9290
const queue = await client.distube.getQueue(oldState);
@@ -113,7 +111,7 @@ client.on("voiceStateUpdate", async (oldState, newState) => {
113111
const embed = new Discord.MessageEmbed()
114112
.setTitle(`Channel empty`)
115113
.setDescription(
116-
`If you have premium, then I won't leave the VC, but if you don't then I will because no one is there in the VC. [Check out Premium](https://muser.pgamerx.com/premium)`
114+
`If you have premium, then I won't leave the VC, but if you don't then I will because no one is there in the VC. [Check out Premium for just 2.99$](https://muser.pgamerx.com/premium)`
117115
)
118116
.setColor("RED");
119117
await channel.send({ embeds: [embed] });
@@ -145,9 +143,9 @@ const mongoose = require("mongoose");
145143
const dbURI = process.env.DBURI;
146144

147145
// noinspection JSCheckFunctionSignatures
148-
mongoose.connect(dbURI).then(whatever => {
149-
console.log("owo did it work")
150-
})
146+
mongoose.connect(dbURI).then((whatever) => {
147+
console.log("owo did it work");
148+
});
151149

152150
// noinspection JSCheckFunctionSignatures
153151

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ const dbURI = process.env.DBURI;
1717

1818
const mongoose = require("mongoose");
1919
// noinspection JSCheckFunctionSignatures
20-
mongoose.connect(dbURI).then(whatever => {
21-
console.log("owo did it work")
22-
})
20+
mongoose.connect(dbURI).then((whatever) => {
21+
console.log("owo did it work");
22+
});
2323

2424
const manager = new ShardingManager("./bot.js", { token: token });
2525

scommands/autoplay.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,8 @@ module.exports = {
3535
embeds: [embed],
3636
});
3737
} else if (data.voter == true) {
38-
let distube;
39-
const is_premium = await db.get(`PREMIUM_${interaction.guild.id}`);
40-
if (is_premium === "yes") {
41-
distube = interaction.client.premium_distube;
42-
} else {
43-
distube = interaction.client.distube;
44-
}
38+
const distube = interaction.client.distube;
39+
4540
if (!interaction.member.voice.channel) {
4641
await interaction.reply({ content: "You are not in a voice channel!" });
4742
return;

scommands/filters.js

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,25 +35,23 @@ module.exports = {
3535
const data = await userinfo.findOne({ UserID: user_id });
3636
if (!data) {
3737
const embed = new MessageEmbed()
38-
.setTitle("Forbidden")
39-
.setDescription("You are not allowed to use this command! Only people who have **voted** for the bot within the last week can use this command! (**Voting is free**)")
40-
.setColor("RED")
41-
.addFields({
42-
name: "Vote for the bot!",
43-
value: "[Vote for Muser on top.gg](https://top.gg/bot/763418289689985035/vote) ",
44-
})
38+
.setTitle("Forbidden")
39+
.setDescription(
40+
"You are not allowed to use this command! Only people who have **voted** for the bot within the last week can use this command! (**Voting is free**)"
41+
)
42+
.setColor("RED")
43+
.addFields({
44+
name: "Vote for the bot!",
45+
value:
46+
"[Vote for Muser on top.gg](https://top.gg/bot/763418289689985035/vote) ",
47+
});
4548

4649
return interaction.reply({
47-
embeds: [embed]
48-
})
50+
embeds: [embed],
51+
});
4952
} else if (data.voter == true) {
50-
let distube;
51-
const is_premium = await db.get(`PREMIUM_${interaction.guild.id}`);
52-
if (is_premium === "yes") {
53-
distube = interaction.client.premium_distube;
54-
} else {
55-
distube = interaction.client.distube;
56-
}
53+
const distube = interaction.client.distube;
54+
5755
let input = interaction.options.getString("filter");
5856
if (!interaction.member.voice.channel) {
5957
await interaction.reply({ content: "You are not in a voice channel!" });

scommands/help.js

Lines changed: 36 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
1-
const { SlashCommandBuilder } = require('@discordjs/builders');
2-
const {MessageEmbed} = require("discord.js")
1+
const { SlashCommandBuilder } = require("@discordjs/builders");
2+
const { MessageEmbed } = require("discord.js");
33
module.exports = {
4-
data: new SlashCommandBuilder()
5-
.setName('help')
6-
.setDescription('Provides help regarding the bot'),
7-
async execute(interaction) {
8-
const embed = new MessageEmbed()
9-
.setTitle(`Muser - The revolutionary Discord bot`)
10-
.setColor("RED")
11-
.setThumbnail("https://muser.pgamerx.com/assets/images/discord-music-removebg-preview.png")
12-
.setDescription(`A fully functional and dedicated Music bot supporting Youtube, Spotify, Soundcloud, Facebook, Instagram, and 700+ other websites for absolutely free!. The better groovy.`)
13-
.addField(`**Limited time Merch**`, `Hey ${interaction.user.username}, we are launching a limited time merch collection at cheap rates. Purchase the merch to get da drip and support me in the process! [Click here for More information](https://www.bonfire.com/botmuser/) `)
14-
.addField(`Commands`,
15-
`
4+
data: new SlashCommandBuilder()
5+
.setName("help")
6+
.setDescription("Provides help regarding the bot"),
7+
async execute(interaction) {
8+
const embed = new MessageEmbed()
9+
.setTitle(`Muser - The revolutionary Discord bot`)
10+
.setColor("RED")
11+
.setThumbnail(
12+
"https://muser.pgamerx.com/assets/images/discord-music-removebg-preview.png"
13+
)
14+
.setDescription(
15+
`A fully functional and dedicated Music bot supporting Youtube, Spotify, Soundcloud, Facebook, Instagram, and 700+ other websites for absolutely free!. The better groovy.`
16+
)
17+
.addField(
18+
`**Limited time Merch**`,
19+
`Hey ${interaction.user.username}, we are launching a limited time merch collection at cheap rates. Purchase the merch to get da drip and support me in the process! [Click here for More information](https://www.bonfire.com/botmuser/) `
20+
)
21+
.addField(
22+
`Commands`,
23+
`
1624
\`/play\` - Plays song/playlist from name/url
1725
\`/seek\` - Seek to a specific part in the song
1826
\`/pause\` - Pauses the current playing song
@@ -24,12 +32,17 @@ module.exports = {
2432
\`/queue\` - Displays the current queue
2533
\`/skip\` - Skips the current song in the playlist
2634
\`/stop\` - Stops playing and deletes the queue
27-
`)
28-
.addField(
29-
"**Important Links**",
30-
"**[Invite Me](https://discord.com/oauth2/authorize?client_id=763418289689985035&scope=+applications.commands+bot&permissions=37084480) | " +
31-
"[Support Server](https://discord.gg/4TeGKpSkdN) | " + "[Upvote on Top.gg](https://top.gg/bot/763418289689985035/vote) | " + "[Premium](https://muser.pgamerx.com/premium) | " + "[Website](https://muser.pgamerx.com/)**")
32-
.setFooter("Developed by PGamerX")
33-
await interaction.reply({embeds: [embed]})
34-
},
35-
};
35+
`
36+
)
37+
.addField(
38+
"**Important Links**",
39+
"**[Invite Me](https://discord.com/oauth2/authorize?client_id=763418289689985035&scope=+applications.commands+bot&permissions=37084480) | " +
40+
"[Support Server](https://discord.gg/4TeGKpSkdN) | " +
41+
"[Upvote on Top.gg](https://top.gg/bot/763418289689985035/vote) | " +
42+
"[Premium](https://muser.pgamerx.com/premium) | " +
43+
"[Website](https://muser.pgamerx.com/)**"
44+
)
45+
.setFooter("Developed by PGamerX");
46+
await interaction.reply({ embeds: [embed] });
47+
},
48+
};

scommands/jump.js

Lines changed: 32 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,35 @@
1-
const { SlashCommandBuilder } = require('@discordjs/builders');
2-
const db = require('quick.db')
1+
const { SlashCommandBuilder } = require("@discordjs/builders");
2+
const db = require("quick.db");
33
module.exports = {
4-
data: new SlashCommandBuilder()
5-
.setName('jump')
6-
.setDescription('Jump to a specific song in the queue')
7-
.addIntegerOption(option =>
8-
option.setName('song_position')
9-
.setDescription("Please Provide song position you want to skip to, you can run /queue command to see the queue")
10-
.setRequired(true))
11-
,
12-
async execute(interaction) {
13-
let distube;
14-
const is_premium = await db.get(`PREMIUM_${interaction.guild.id}`)
15-
if(is_premium === "yes"){
16-
distube = interaction.client.premium_distube
17-
}else{
18-
distube = interaction.client.distube
19-
}
20-
const number = interaction.options.getInteger('song_position');
4+
data: new SlashCommandBuilder()
5+
.setName("jump")
6+
.setDescription("Jump to a specific song in the queue")
7+
.addIntegerOption((option) =>
8+
option
9+
.setName("song_position")
10+
.setDescription(
11+
"Please Provide song position you want to skip to, you can run /queue command to see the queue"
12+
)
13+
.setRequired(true)
14+
),
15+
async execute(interaction) {
16+
const distube = interaction.client.distube;
17+
const number = interaction.options.getInteger("song_position");
2118

22-
if(!interaction.member.voice.channel) {
23-
await interaction.reply({content: "You are not in a voice channel!"})
24-
return
25-
}
26-
const queue = distube.getQueue(interaction)
27-
if(!queue){
28-
await interaction.reply(`No song is playing! `)
29-
return
30-
}
19+
if (!interaction.member.voice.channel) {
20+
await interaction.reply({ content: "You are not in a voice channel!" });
21+
return;
22+
}
23+
const queue = distube.getQueue(interaction);
24+
if (!queue) {
25+
await interaction.reply(`No song is playing! `);
26+
return;
27+
}
3128

32-
await interaction.reply(`:arrow_right: Jumping to ${number}...`)
33-
await distube.jump(queue, parseInt(number)).catch(async (err) => {
34-
await interaction.reply(`Invalid song position`)
35-
console.log(err)
36-
37-
})
38-
39-
40-
41-
},
42-
};
29+
await interaction.reply(`:arrow_right: Jumping to ${number}...`);
30+
await distube.jump(queue, parseInt(number)).catch(async (err) => {
31+
await interaction.reply(`Invalid song position`);
32+
console.log(err);
33+
});
34+
},
35+
};

scommands/loop.js

Lines changed: 36 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,41 @@
1-
const { SlashCommandBuilder } = require('@discordjs/builders');
2-
const db = require("quick.db")
1+
const { SlashCommandBuilder } = require("@discordjs/builders");
2+
const db = require("quick.db");
33
module.exports = {
4-
data: new SlashCommandBuilder()
5-
.setName('loop')
6-
.setDescription('Apply loop on the current queue/song')
7-
.addStringOption(option =>
8-
option.setName('type')
9-
.setDescription("Please provide the type of loop.")
10-
.setRequired(true)
11-
.addChoice("song","song")
12-
.addChoice("queue","queue")
13-
.addChoice("off","off")
4+
data: new SlashCommandBuilder()
5+
.setName("loop")
6+
.setDescription("Apply loop on the current queue/song")
7+
.addStringOption((option) =>
8+
option
9+
.setName("type")
10+
.setDescription("Please provide the type of loop.")
11+
.setRequired(true)
12+
.addChoice("song", "song")
13+
.addChoice("queue", "queue")
14+
.addChoice("off", "off")
15+
),
16+
async execute(interaction) {
17+
const distube = interaction.client.distube;
18+
19+
let input = interaction.options.getString("type");
20+
if (!interaction.member.voice.channel) {
21+
await interaction.reply({ content: "You are not in a voice channel!" });
22+
return;
23+
}
1424

15-
)
16-
,
17-
async execute(interaction) {
18-
let distube;
19-
const is_premium = await db.get(`PREMIUM_${interaction.guild.id}`)
20-
if(is_premium === "yes"){
21-
distube = interaction.client.premium_distube
22-
}else{
23-
distube = interaction.client.distube
24-
}
25-
let input = interaction.options.getString('type');
26-
if(!interaction.member.voice.channel) {
27-
await interaction.reply({content: "You are not in a voice channel!"})
28-
return
29-
}
30-
3125
let mode;
32-
if(input === "song"){
33-
mode = 1
34-
}else if(input === "queue"){
35-
mode = 2
36-
}else if(input === "off"){
37-
mode = 0
26+
if (input === "song") {
27+
mode = 1;
28+
} else if (input === "queue") {
29+
mode = 2;
30+
} else if (input === "off") {
31+
mode = 0;
3832
}
39-
const queue = distube.getQueue(interaction)
40-
if(!queue){
41-
await interaction.reply(`No song is playing!`)
42-
return
33+
const queue = distube.getQueue(interaction);
34+
if (!queue) {
35+
await interaction.reply(`No song is playing!`);
36+
return;
4337
}
44-
await interaction.reply(`🔁 Setting loop mode to ${input}..`)
45-
await distube.setRepeatMode(queue,parseInt(mode))
46-
},
47-
};
38+
await interaction.reply(`🔁 Setting loop mode to ${input}..`);
39+
await distube.setRepeatMode(queue, parseInt(mode));
40+
},
41+
};

scommands/pause.js

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,22 @@
11
// noinspection DuplicatedCode
22

3-
const { SlashCommandBuilder } = require('@discordjs/builders');
4-
const db = require('quick.db')
3+
const { SlashCommandBuilder } = require("@discordjs/builders");
4+
const db = require("quick.db");
55
module.exports = {
6-
data: new SlashCommandBuilder()
7-
.setName('pause')
8-
.setDescription('Pauses the current playing song!')
9-
,
10-
async execute(interaction) {
11-
let distube;
12-
const is_premium = await db.get(`PREMIUM_${interaction.guild.id}`)
13-
if(is_premium === "yes"){
14-
distube = interaction.client.premium_distube
15-
}else{
16-
distube = interaction.client.distube
17-
}
18-
if(!interaction.member.voice.channel) {await interaction.reply({content: "You are not in a voice channel!"})
19-
return}
6+
data: new SlashCommandBuilder()
7+
.setName("pause")
8+
.setDescription("Pauses the current playing song!"),
9+
async execute(interaction) {
10+
const distube = interaction.client.distube;
2011

21-
const queue = distube.getQueue(interaction)
22-
if(!queue) return await interaction.reply(`No song is playing!`)
23-
await interaction.reply(`⏸ Pausing the song`)
24-
await distube.pause(queue)
25-
},
26-
};
12+
if (!interaction.member.voice.channel) {
13+
await interaction.reply({ content: "You are not in a voice channel!" });
14+
return;
15+
}
16+
17+
const queue = distube.getQueue(interaction);
18+
if (!queue) return await interaction.reply(`No song is playing!`);
19+
await interaction.reply(`⏸ Pausing the song`);
20+
await distube.pause(queue);
21+
},
22+
};

scommands/ping.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module.exports = {
1515
});
1616
await interaction.editReply({
1717
content: `Roundtrip latency: ${
18-
sent.createdTimestamp - interaction.createdTimestamp
18+
sent.createdTimestamp - interaction.createdTimestamp
1919
}ms`,
2020
ephemeral: true,
2121
});

0 commit comments

Comments
 (0)