Skip to content

Commit

Permalink
v3.0_final
Browse files Browse the repository at this point in the history
  • Loading branch information
notscrappie committed Oct 11, 2022
1 parent ca9c6b8 commit 0c86ced
Show file tree
Hide file tree
Showing 32 changed files with 1,067 additions and 406 deletions.
21 changes: 9 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,38 @@
{
"name": "evelyn",
"version": "3.0.0-r1",
"version": "3.0.0",
"description": "A Discord Bot that puts you as its first priority with no paywalls to interrupt your supercharged experience.",
"main": "src/shard.js",
"scripts": {
"start": "node ./src/shard.js",
"dev": "node ./src/structures/index.js"
},
"dependencies": {
"better-erela.js-apple": "^1.0.5",
"better-erela.js-spotify": "^1.3.11",
"canvacord": "^5.4.8",
"chalk": "^4.1.2",
"connect-mongodb-session": "^3.1.1",
"dbd-soft-ui": "^1.0.35-beta.1",
"discord-dashboard": "^2.3.44",
"dbd-soft-ui": "^1.5.2-beta.1",
"discord-dashboard": "^2.3.45",
"discord-html-transcripts": "^3.1.0",
"discord-hybrid-sharding": "^1.7.4",
"discord-together": "^1.3.31",
"discord-xp": "^1.1.16",
"discord.js": "^14.5.0",
"dream-api": "^1.0.8",
"erela.js": "github:menudocs/erela.js#build",
"erela.js-deezer": "^1.0.7",
"discord.js": "^14.6.0",
"express-session": "^1.17.3",
"genius-lyrics": "^4.4.0",
"glob": "^8.0.3",
"humanize-duration": "^3.27.3",
"imdb-api": "^4.4.1",
"mongoose": "^6.6.3",
"kazagumo": "^2.2.3",
"kazagumo-spotify": "^1.1.5",
"mongoose": "^6.6.5",
"ms": "^2.1.3",
"nekobot-api": "^2.1.0",
"node-kitsu": "^1.1.1",
"pretty-ms": "^7.0.1",
"session-file-store": "^1.5.0",
"superagent": "^8.0.1",
"wordle.engine": "github:AmitKumarHQ/wordle.engine#CommonJS"
"shoukaku": "^3.2.0",
"superagent": "^8.0.2"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion src/buttons/joinGiveaway.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ module.exports = {
messageID: interaction.message.id,
},
{
$push: { Entered: interaction.user.id },
$push: { enteredUsers: interaction.user.id },
}
).then(() => {
embed
Expand Down
2 changes: 1 addition & 1 deletion src/buttons/pause.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
/**
* @param {ButtonInteraction} interaction
*/
execute(interaction) {
async execute(interaction) {
const player = client.manager.players.get(interaction.guild.id);

if (!player) return;
Expand Down
6 changes: 3 additions & 3 deletions src/buttons/shuffle.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ module.exports = {
.setTimestamp();

if (!player.playing)
return interaction.editReply({
return interaction.reply({
embeds: [notPlaying],
ephemeral: true,
});

if (!player.queue.length)
return interaction.editReply({
return interaction.reply({
embeds: [noQueue],
ephemeral: true,
});
Expand All @@ -42,7 +42,7 @@ module.exports = {
})
.setTimestamp();

await player.queue.shuffle();
player.queue.shuffle();

return interaction.reply({ embeds: [shuffleEmbed] });
},
Expand Down
2 changes: 1 addition & 1 deletion src/buttons/skip.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = {
})
.setTimestamp();

await player.stop();
player.skip();

return interaction.reply({ embeds: [skipEmbed] });
},
Expand Down
73 changes: 73 additions & 0 deletions src/commands/moderation/ban.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
const {
ChatInputCommandInteraction,
SlashCommandBuilder,
EmbedBuilder,
PermissionFlagsBits,
Client,
} = require("discord.js");

module.exports = {
data: new SlashCommandBuilder()
.setName("ban")
.setDescription("Ban a user.")
.setDefaultMemberPermissions(PermissionFlagsBits.BanMembers)
.addUserOption((option) =>
option
.setName("target")
.setDescription("Provide a target.")
.setRequired(true)
)
.addStringOption((option) =>
option.setName("reason").setDescription("Provide a reason.")
),
/**
* @param {ChatInputCommandInteraction} interaction
* @param {Client} client
*/
async execute(interaction, client) {
const { options } = interaction;
const target = options.getMember("target");
const reason = options.getString("reason") || "No reason specified.";

const higherEmbed = new EmbedBuilder()
.setColor("Blurple")
.setDescription(
"🔹 | You can't ban someone with a role higher than yours."
)
.setTimestamp();

const evenHigherEmbed = new EmbedBuilder()
.setColor("Blurple")
.setDescription("🔹 | I can't ban someone with a role higher than mine.")
.setTimestamp();

if (
target.roles.highest.position >= interaction.member.roles.highest.position
)
return interaction.reply({ embeds: [higherEmbed], ephemeral: true });
if (
target.roles.highest.position >=
interaction.guild.members.me.roles.highest.position
)
return interaction.reply({ embeds: [evenHigherEmbed], ephemeral: true });

const bannedEmbed = new EmbedBuilder()
.setColor("Blurple")
.setTitle(`${client.user.username} | Notice`)
.setDescription(
`You have been banned from ${interaction.guild.name} for ${reason}`
)
.setTimestamp();

const successEmbed = new EmbedBuilder()
.setColor("Blurple")
.setDescription(`${target.user.tag} has been banned for ${reason}.`)
.setTimestamp();

target.send({ embeds: [bannedEmbed] }).catch(_err);

return interaction.reply({ embeds: [successEmbed] }).then(() => {
target.ban({ reason });
});
},
};
73 changes: 73 additions & 0 deletions src/commands/moderation/kick.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
const {
ChatInputCommandInteraction,
SlashCommandBuilder,
EmbedBuilder,
PermissionFlagsBits,
Client,
} = require("discord.js");

module.exports = {
data: new SlashCommandBuilder()
.setName("kick")
.setDescription("Kick a user.")
.setDefaultMemberPermissions(PermissionFlagsBits.KickMembers)
.addUserOption((option) =>
option
.setName("target")
.setDescription("Provide a target.")
.setRequired(true)
)
.addStringOption((option) =>
option.setName("reason").setDescription("Provide a reason.")
),
/**
* @param {ChatInputCommandInteraction} interaction
* @param {Client} client
*/
async execute(interaction, client) {
const { options } = interaction;
const target = options.getMember("target");
const reason = options.getString("reason") || "No reason specified.";

const higherEmbed = new EmbedBuilder()
.setColor("Blurple")
.setDescription(
"🔹 | You can't kick someone with a role higher than yours."
)
.setTimestamp();

const evenHigherEmbed = new EmbedBuilder()
.setColor("Blurple")
.setDescription("🔹 | I can't kick someone with a role higher than mine.")
.setTimestamp();

if (
target.roles.highest.position >= interaction.member.roles.highest.position
)
return interaction.reply({ embeds: [higherEmbed], ephemeral: true });
if (
target.roles.highest.position >=
interaction.guild.members.me.roles.highest.position
)
return interaction.reply({ embeds: [evenHigherEmbed], ephemeral: true });

const kickedNotif = new EmbedBuilder()
.setColor("Blurple")
.setTitle(`${client.user.username} | Notice`)
.setDescription(
`You have been kicked from ${interaction.guild.name} for ${reason}`
)
.setTimestamp();

const successEmbed = new EmbedBuilder()
.setColor("Blurple")
.setDescription(`${target.user.tag} has been kicked for ${reason}.`)
.setTimestamp();

target.send({ embeds: [kickedNotif] }).catch(_err);

return interaction.reply({ embeds: [successEmbed] }).then(() => {
target.kick({ reason });
});
},
};
76 changes: 76 additions & 0 deletions src/commands/moderation/lock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
const {
ChatInputCommandInteraction,
SlashCommandBuilder,
EmbedBuilder,
PermissionsBitField,
} = require("discord.js");
const { ManageChannels, SendMessages } = PermissionsBitField.Flags;
const DB = require("../../structures/schemas/lockdown.js");
const ms = require("ms");

module.exports = {
data: new SlashCommandBuilder()
.setName("lock")
.setDescription("Lock a channel.")
.setDefaultMemberPermissions(ManageChannels)
.addStringOption((option) =>
option
.setName("time")
.setDescription("How long would you like the quarantine to last?")
)
.addStringOption((option) =>
option
.setName("reason")
.setDescription("Provide a reason for the quarantine.")
),
/**
* @param {ChatInputCommandInteraction} interaction
*/
async execute(interaction) {
const { guild, channel, options } = interaction;
const reason = options.getString("reason") || "Unknown";
const time = options.getString("time");
const Embed = new EmbedBuilder();

if (!channel.permissionsFor(guild.id).has(SendMessages))
return interaction.reply({
embeds: [
Embed.setDescription("🔹 | This channel is already locked.")
.setColor("Blurple")
.setTimestamp(),
],
});

channel.permissionOverwrites.edit(guild.id, {
SendMessages: false,
});
interaction.reply({
embeds: [
Embed.setDescription(`🔹 | This channel is now locked for: ${reason}`)
.setColor("Blurple")
.setTimestamp(),
],
});

if (time) {
const expiredate = Date.now() + ms(time);
DB.create({ GuildID: guild.id, ChannelID: channel.id, Time: expiredate });

setTimeout(async () => {
channel.permissionOverwrites.edit(guild.id, {
SendMessages: null,
});
interaction
.editReply({
embeds: [
Embed.setDescription(
"🔹 | This channel has been unlocked."
).setColor("Blurple"),
],
})
.catch(() => {});
await DB.deleteOne({ ChannelID: channel.id });
}, ms(time));
}
},
};
64 changes: 64 additions & 0 deletions src/commands/moderation/purge.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
const {
ChatInputCommandInteraction,
SlashCommandBuilder,
EmbedBuilder,
PermissionsBitField,
} = require("discord.js");
const { ManageMessages } = PermissionsBitField.Flags;

module.exports = {
data: new SlashCommandBuilder()
.setName("clear")
.setDescription("Clear a number of messages.")
.setDefaultMemberPermissions(ManageMessages)
.addStringOption((options) =>
options
.setName("number")
.setDescription("Provide the number of messages you'd like to delete.")
.setRequired(true)
),
/**
* @param {ChatInputCommandInteraction} interaction
*/
async execute(interaction) {
const { options } = interaction;
const messages = options.getString("number");

if (number > 100)
return interaction.reply({
embeds: [
new EmbedBuilder()
.setColor("Blurple")
.setDescription(
"🔹 | You can't delete more than 100 messages at once."
)
.setTimestamp(),
],
ephemeral: true,
});

if (number < 1)
return interaction.reply({
embeds: [
new EmbedBuilder()
.setColor("Blurple")
.setDescription(
"🔹 | You can't delete less than 1 message at once."
)
.setTimestamp(),
],
ephemeral: true,
});

await interaction.channel.bulkDelete(number, true).then(() => {
return interaction.reply({
embeds: [
new EmbedBuilder()
.setColor("Blurple")
.setDescription(`🔹 | Cleared ${number} messages.`)
.setTimestamp(),
],
});
});
},
};
Loading

0 comments on commit 0c86ced

Please sign in to comment.