Skip to content

Commit

Permalink
Merge pull request #470 from saiteja-madha/5.5.0
Browse files Browse the repository at this point in the history
5.5.0 Release
  • Loading branch information
saiteja-madha authored Feb 12, 2024
2 parents bb0d574 + 3a98d2a commit ca32242
Show file tree
Hide file tree
Showing 24 changed files with 1,232 additions and 4,716 deletions.
3 changes: 2 additions & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
"printWidth": 120,
"bracketSpacing": true,
"arrowParens": "always",
"endOfLine": "crlf"
"endOfLine": "lf"
}

2 changes: 1 addition & 1 deletion config.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ module.exports = {

IMAGE: {
ENABLED: false,
BASE_API: "https://strangeapi.fun/api",
BASE_API: "https://strangeapi.hostz.me/api",
},

INVITE: {
Expand Down
2 changes: 1 addition & 1 deletion dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Base image
FROM node:16-alpine
FROM node:18-alpine

# Set the working directory in the container
WORKDIR /usr/src/app
Expand Down
5,052 changes: 761 additions & 4,291 deletions package-lock.json

Large diffs are not rendered by default.

35 changes: 18 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
{
"name": "discord-js-bot",
"version": "5.4.0",
"version": "5.5.0",
"description": "An open-source, multipurpose discord bot built using discord-js",
"main": "bot.js",
"author": "Sai Teja M",
"license": "ISC",
"engines": {
"node": ">=16.11.0"
"node": ">=18.0.0"
},
"scripts": {
"dev": "nodemon .",
"start": "node .",
"format": "prettier --write src",
"docker:build": "docker build -t saitejamadha/discord-js-bot:5.4.0 ."
"docker:package": "tar -cf discord-js-bot.tar dashboard logs src bot.js config.js dockerfile package.json package-lock.json",
"docker:build": "docker build -t saitejamadha/discord-js-bot:5.5.0 ."
},
"homepage": "https://github.com/saiteja-madha/discord-js-bot#readme",
"repository": {
Expand All @@ -29,7 +30,7 @@
"ascii-table": "0.0.9",
"btoa": "^1.2.1",
"common-tags": "^1.8.2",
"connect-mongo": "^5.0.0",
"connect-mongo": "^5.1.0",
"country-emoji-languages": "^1.0.0",
"discord-giveaways": "^6.0.1",
"discord-together": "^1.3.31",
Expand All @@ -38,18 +39,18 @@
"ejs": "^3.1.9",
"enhanced-ms": "^2.3.0",
"express": "^4.18.2",
"express-session": "^1.17.3",
"express-session": "^1.18.0",
"fixedsize-map": "^1.0.1",
"iso-639-1": "^2.1.15",
"iso-639-1": "^3.1.0",
"lavaclient": "^4.1.1",
"module-alias": "^2.2.3",
"moment": "^2.29.4",
"mongoose": "^7.3.4",
"moment": "^2.30.1",
"mongoose": "^8.1.1",
"nekos.life": "^3.0.0",
"node-fetch": "^2.6.12",
"node-fetch": "^2.7.0",
"os": "^0.1.2",
"pino": "^8.14.1",
"pino-pretty": "^10.0.1",
"pino": "^8.18.0",
"pino-pretty": "^10.3.1",
"pretty-ms": "^7.0.1",
"snakecord": "^1.0.9",
"sourcebin_js": "^0.0.3-ignore",
Expand All @@ -59,17 +60,17 @@
"twemoji-parser": "^14.0.0"
},
"optionalDependencies": {
"bufferutil": "^4.0.7",
"bufferutil": "^4.0.8",
"erlpack": "^0.1.4",
"utf-8-validate": "^6.0.3",
"zlib-sync": "^0.1.8"
"zlib-sync": "^0.1.9"
},
"devDependencies": {
"eslint": "^8.45.0",
"eslint": "^8.56.0",
"eslint-plugin-jsdoc": "^46.4.3",
"node": "^20.4.0",
"nodemon": "^3.0.1",
"prettier": "3.0.0"
"node": "^18.18.2",
"nodemon": "^3.0.3",
"prettier": "3.2.5"
},
"keywords": [
"discord",
Expand Down
1 change: 1 addition & 0 deletions src/commands/giveaways/giveaway.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ module.exports = {
//
if (sub === "start") {
const channel = interaction.options.getChannel("channel");
await interaction.followUp("Starting Giveaway system...");
return await runModalSetup(interaction, channel);
}

Expand Down
3 changes: 2 additions & 1 deletion src/commands/invites/inviterank.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,10 @@ async function addInviteRank({ guild }, role, invites, settings) {
if (exists) {
exists.invites = invites;
msg += "Previous configuration found for this role. Overwriting data\n";
} else {
settings.invite.ranks.push({ _id: role.id, invites });
}

settings.invite.ranks.push({ _id: role.id, invites });
await settings.save();
return `${msg}Success! Configuration saved.`;
}
Expand Down
2 changes: 2 additions & 0 deletions src/commands/invites/inviteranks.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ async function getInviteRanks({ guild }, settings) {
}
});

if (!str) return "No invite ranks configured in this server";

const embed = new EmbedBuilder()
.setAuthor({ name: "Invite Ranks" })
.setColor(EMBED_COLORS.BOT_EMBED)
Expand Down
2 changes: 1 addition & 1 deletion src/commands/moderation/message/move.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module.exports = {
const target = await message.guild.resolveMember(args[0], true);
if (!target) return message.safeReply(`No user found matching ${args[0]}`);

const channels = message.guild.findMatchingChannels(args[1]);
const channels = message.guild.findMatchingVoiceChannels(args[1]);
if (!channels.length) return message.safeReply("No matching channels found");
const targetChannel = channels.pop();
if (!targetChannel.type === ChannelType.GuildVoice && !targetChannel.type === ChannelType.GuildStageVoice) {
Expand Down
154 changes: 77 additions & 77 deletions src/commands/music/bassboost.js
Original file line number Diff line number Diff line change
@@ -1,77 +1,77 @@
const { musicValidations } = require("@helpers/BotUtils");
const { ApplicationCommandOptionType } = require("discord.js");

const levels = {
none: 0.0,
low: 0.1,
medium: 0.15,
high: 0.25,
};

/**
* @type {import("@structures/Command")}
*/
module.exports = {
name: "bassboost",
description: "set bassboost level",
category: "MUSIC",
validations: musicValidations,
command: {
enabled: true,
minArgsCount: 1,
usage: "<none|low|medium|high>",
},
slashCommand: {
enabled: true,
options: [
{
name: "level",
description: "bassboost level",
type: ApplicationCommandOptionType.String,
required: true,
choices: [
{
name: "none",
value: "none",
},
{
name: "low",
value: "low",
},
{
name: "medium",
value: "medium",
},
{
name: "high",
value: "high",
},
],
},
],
},

async messageRun(message, args) {
let level = "none";
if (args.length && args[0].toLowerCase() in levels) level = args[0].toLowerCase();
const response = setBassBoost(message, level);
await message.safeReply(response);
},

async interactionRun(interaction) {
let level = interaction.options.getString("level");
const response = setBassBoost(interaction, level);
await interaction.followUp(response);
},
};

/**
* @param {import("discord.js").CommandInteraction|import("discord.js").Message} arg0
* @param {number} level
*/
function setBassBoost({ client, guildId }, level) {
const player = client.musicManager.getPlayer(guildId);
const bands = new Array(3).fill(null).map((_, i) => ({ band: i, gain: levels[level] }));
player.setEqualizer(...bands);
return `> Set the bassboost level to \`${level}\``;
}
const { musicValidations } = require("@helpers/BotUtils");
const { ApplicationCommandOptionType } = require("discord.js");

const levels = {
none: 0.0,
low: 0.1,
medium: 0.15,
high: 0.25,
};

/**
* @type {import("@structures/Command")}
*/
module.exports = {
name: "bassboost",
description: "set bassboost level",
category: "MUSIC",
validations: musicValidations,
command: {
enabled: true,
minArgsCount: 1,
usage: "<none|low|medium|high>",
},
slashCommand: {
enabled: true,
options: [
{
name: "level",
description: "bassboost level",
type: ApplicationCommandOptionType.String,
required: true,
choices: [
{
name: "none",
value: "none",
},
{
name: "low",
value: "low",
},
{
name: "medium",
value: "medium",
},
{
name: "high",
value: "high",
},
],
},
],
},

async messageRun(message, args) {
let level = "none";
if (args.length && args[0].toLowerCase() in levels) level = args[0].toLowerCase();
const response = setBassBoost(message, level);
await message.safeReply(response);
},

async interactionRun(interaction) {
let level = interaction.options.getString("level");
const response = setBassBoost(interaction, level);
await interaction.followUp(response);
},
};

/**
* @param {import("discord.js").CommandInteraction|import("discord.js").Message} arg0
* @param {number} level
*/
function setBassBoost({ client, guildId }, level) {
const player = client.musicManager.getPlayer(guildId);
const bands = new Array(3).fill(null).map((_, i) => ({ band: i, gain: levels[level] }));
player.setEqualizer(...bands);
return `> Set the bassboost level to \`${level}\``;
}
Loading

0 comments on commit ca32242

Please sign in to comment.