Skip to content

Commit

Permalink
version 2.1 -- upgrades people, upgrades
Browse files Browse the repository at this point in the history
- Updated package.json to reflect new changes and bumps in packages.
- Added bot permissions system to further idiot-proof Evelyn. (will be added to all commands in 2.2)
- Added the blacklisting system, works for servers and users.
- Removed non-working features from dashboard.
- Revamped commands handler.
- A lot of fixes for the music system. (check evelyn-music-module for changes)
- Added giveaway system (thanks to Cit999).
- Removed unused schemas.
  • Loading branch information
notscrappie committed Aug 25, 2022
1 parent 8d5f496 commit b12e760
Show file tree
Hide file tree
Showing 57 changed files with 1,144 additions and 930 deletions.
25 changes: 13 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aeolian",
"version": "2.0.0",
"name": "evelyn",
"version": "2.1.0",
"description": "A Discord Bot that puts you as its first priority with no paywalls to interrupt your supercharged experience.",
"main": "src/structures/index.js",
"scripts": {
Expand All @@ -9,31 +9,32 @@
"dependencies": {
"better-erela.js-apple": "^1.0.4",
"better-erela.js-spotify": "^1.3.9",
"canvacord": "^5.4.4",
"canvacord": "^5.4.6",
"chalk": "^4.1.2",
"dbd-dark-dashboard": "^1.6.591",
"discord-dashboard": "^2.3.40",
"discord-together": "github:notscrappie/discord-together",
"discord.js": "^14.1.2",
"discord-dashboard": "^2.3.41",
"discord.js": "^14.3.0",
"erela.js": "^2.3.3",
"erela.js-deezer": "^1.0.7",
"genius-lyrics": "^4.3.8",
"genius-lyrics": "^4.4.0",
"glob": "^8.0.3",
"humanize-duration": "^3.27.2",
"imdb-api": "^4.4.1",
"mongoose": "^6.5.1",
"mongoose": "^6.5.2",
"ms": "^2.1.3",
"node-kitsu": "^1.1.1",
"pretty-ms": "^7.0.1",
"string-progressbar": "^1.0.4",
"superagent": "^8.0.0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/cryolabs/aeolian.git"
"url": "git+https://github.com/notscrappie/evelyn.git"
},
"author": "CryoLabs/notscrappie",
"author": "notscrappie",
"license": "MIT",
"bugs": {
"url": "https://github.com/cryolabs/aeolian/issues"
"url": "https://github.com//notscrappie/evelyn/issues"
},
"homepage": "https://github.com/cryolabs/aeolian#readme"
"homepage": "https://github.com/notscrappie/evelyn#readme"
}
1 change: 1 addition & 0 deletions src/commands/context/avatar.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const {
} = require("discord.js");

module.exports = {
botPermissions: ["SendMessages"],
data: new ContextMenuCommandBuilder()
.setName("User Avatar")
.setType(ApplicationCommandType.User),
Expand Down
1 change: 1 addition & 0 deletions src/commands/context/banner.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const {
} = require("discord.js");

module.exports = {
botPermissions: ["SendMessages", "EmbedLinks"],
data: new ContextMenuCommandBuilder()
.setName("User Banner")
.setType(ApplicationCommandType.User),
Expand Down
1 change: 1 addition & 0 deletions src/commands/context/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const {
} = require("discord.js");

module.exports = {
botPermissions: ["SendMessages"],
data: new ContextMenuCommandBuilder()
.setName("User Information")
.setType(ApplicationCommandType.User),
Expand Down
103 changes: 103 additions & 0 deletions src/commands/developer/blacklist-remove.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
const {
SlashCommandBuilder,
ChatInputCommandInteraction,
Client,
EmbedBuilder,
} = require("discord.js");
const guildBLK = require("../../structures/schemas/serverBlacklist.js");
const userBLK = require("../../structures/schemas/userBlacklist.js");

module.exports = {
botPermissions: ["SendMessages"],
developer: true,
data: new SlashCommandBuilder()
.setName("blacklist-remove")
.setDescription("Remove a user or server from the blacklist.")
.addSubcommand((options) =>
options
.setName("server")
.setDescription("Remove a server from the blacklist.")
.addStringOption((option) =>
option
.setName("serverid")
.setDescription(
"Provide the server ID of the server you would like to remove from the blacklist."
)
.setRequired(true)
)
)
.addSubcommand((options) =>
options
.setName("user")
.setDescription("Remove a user from the blacklist.")
.addStringOption((option) =>
option
.setName("userid")
.setDescription(
"Provide the ID of the user you would like to blacklist."
)
.setRequired(true)
)
),
/**
* @param {ChatInputCommandInteraction} interaction
* @param {Client} client
*/
async execute(interaction, client) {
const embed = new EmbedBuilder();
const { options } = interaction;

switch (options.getSubcommand()) {
case "server": {
const gID = options.getString("serverid");
const data = await guildBLK.findOne({ serverID: gID });

if (data) {
await guildBLK.deleteOne({ serverID: gID });
embed
.setColor("Blurple")
.setTitle(`${client.user.username} | Blacklist`)
.setDescription(
`🔹 | This guild has been removed from the blacklist.`
)
.setTimestamp();
return interaction.reply({ embeds: [embed] });
}

if (!data) {
embed
.setColor("Blurple")
.setTitle(`${client.user.username} | Blacklist`)
.setDescription(`🔹 | This guild is not blacklisted.`)
.setTimestamp();
return interaction.reply({ embeds: [embed] });
}
}
case "user": {
const uID = options.getString("userid");
const data = await userBLK.findOne({ serverID: uID });

if (data) {
await userBLK.deleteOne({ userid: uID });
embed
.setColor("Blurple")
.setTitle(`${client.user.username} | Blacklist`)
.setDescription(
`🔹 | This user has been removed from the blacklist.`
)
.setTimestamp();
return interaction.reply({ embeds: [embed] });
}

if (!data) {
embed
.setColor("Blurple")
.setTitle(`${client.user.username} | Blacklist`)
.setDescription(`🔹 | This user is not blacklisted.`)
.setTimestamp();
return interaction.reply({ embeds: [embed] });
}
}
}
},
};
116 changes: 116 additions & 0 deletions src/commands/developer/blacklist.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
const {
SlashCommandBuilder,
ChatInputCommandInteraction,
Client,
EmbedBuilder,
} = require("discord.js");
const guildBLK = require("../../structures/schemas/serverBlacklist.js");
const userBLK = require("../../structures/schemas/userBlacklist.js");

module.exports = {
botPermissions: ["SendMessages"],
developer: true,
data: new SlashCommandBuilder()
.setName("blacklist")
.setDescription("Blacklist a user or server from using the bot.")
.addSubcommand((options) =>
options
.setName("server")
.setDescription("Blacklist a server.")
.addStringOption((option) =>
option
.setName("serverid")
.setDescription(
"Provide the server ID of the server you would like to blacklist."
)
.setRequired(true)
)
.addStringOption((option) =>
option
.setName("reason")
.setDescription("Provide the reason of the blacklist.")
.setRequired(true)
)
)
.addSubcommand((options) =>
options
.setName("user")
.setDescription("Blacklist a user.")
.addStringOption((option) =>
option
.setName("userid")
.setDescription(
"Provide the ID of the user you would like to blacklist."
)
.setRequired(true)
)
.addStringOption((option) =>
option
.setName("reason")
.setDescription("Provide the reason of the blacklist.")
.setRequired(true)
)
),
/**
* @param {ChatInputCommandInteraction} interaction
* @param {Client} client
*/
async execute(interaction, client) {
const embed = new EmbedBuilder();
const { options } = interaction;

switch (options.getSubcommand()) {
case "server": {
const gldID = options.getString("serverid");
const reason = options.getString("reason");
const guild = client.guilds.cache.get(gldID);
const gName = guild.name || "A mysterious guild";
const gID = guild.id;

const data = await guildBLK.findOne({ serverID: gID });
if (!data) {
const newBlacklist = new guildBLK({
serverID: gID,
reason: reason,
time: Date.now(),
});

await newBlacklist.save();

embed
.setColor("Blurple")
.setTitle(`${client.user.username} | Blacklist`)
.setDescription(`🔹 | ${gName} has been successfully blacklisted.`)
.addFields({ name: "🔹 | Reason", value: reason });
return interaction.reply({ embeds: [embed] });
}
}
case "user": {
const userID = options.getString("userid");
const reason = options.getString("reason");

const user = await client.users.fetch(userID);
const uName = user.tag || "A mysterious user";
const uID = user.id;

const data = await userBLK.findOne({ userid: uID });
if (!data) {
const newBlacklist = new userBLK({
userid: uID,
reason: reason,
time: Date.now(),
});

await newBlacklist.save();

embed
.setColor("Blurple")
.setTitle(`${client.user.username} | Blacklist`)
.setDescription(`🔹 | ${uName} has been successfully blacklisted.`)
.addFields({ name: "🔹 | Reason", value: reason });
return interaction.reply({ embeds: [embed] });
}
}
}
},
};
102 changes: 102 additions & 0 deletions src/commands/developer/status.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
const {
Client,
SlashCommandBuilder,
ChatInputCommandInteraction,
EmbedBuilder,
} = require("discord.js");
const os = require("os");
const actualTime = require("humanize-duration");
const { connection } = require("mongoose");

module.exports = {
botPermissions: ["SendMessages"],
developer: true,
data: new SlashCommandBuilder()
.setName("status")
.setDescription("Shows the bot's status."),
/**
* @param {ChatInputCommandInteraction} interaction
* @param {Client} client
*/
async execute(interaction, client) {
const model = os.cpus()[0].model;
const cores = os.cpus().length;
const platform = os.platform();

await client.application.fetch();

const embed = new EmbedBuilder()
.setColor("Grey")
.setTitle(`${client.user.username} | Status`)
.addFields(
{ name: "**Client**", value: "🔷 Online", inline: true },
{ name: "**Ping**", value: `${client.ws.ping}ms`, inline: true },
{
name: "**Uptime**",
value: `${actualTime(client.uptime)}`,
inline: true,
},
{
name: "**Database**",
value: `${switchTo(connection.readyState)}`,
inline: true,
},
{
name: "**Currently serving**",
value: `${client.guilds.cache.size} servers`,
inline: true,
},
{
name: "**Active since**",
value: `<t:${parseInt(client.user.createdTimestamp / 1000)}:R>`,
inline: true,
},
{
name: "**Owner**",
value: `${client.application.owner || "None"}`,
inline: true,
},
{
name: "**OS**",
value: platform.replace("win32", "Windows").replace("linux", "Linux"),
inline: true,
},
{
name: "**CPU**",
value: `${model} with ${cores} cores`,
inline: true,
},
{
name: "**Memory Usage**",
value: `${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(
2
)}%`,
inline: true,
}
)
.setThumbnail(
client.user.avatarURL({ format: "png", dynamic: true, size: 1024 })
)
.setTimestamp();
return interaction.reply({ embeds: [embed] });
},
};

function switchTo(val) {
var status = " ";
switch (val) {
case 0:
status = "🟥 Disconnected";
break;
case 1:
status = `🔷 Connected`;
break;
case 2:
status = `🟨 Connecting`;
break;
case 3:
status = `🟨 Disconnecting`;
break;
}
return status;
}
Loading

0 comments on commit b12e760

Please sign in to comment.