From 291ca998b0ae09e4e50d9e4a24c01873600e015a Mon Sep 17 00:00:00 2001 From: mirko93s Date: Tue, 19 Jul 2022 09:31:37 +0200 Subject: [PATCH] 14.0.0 everything should be updated to djs v14 --- chill.js | 1 + events/guildMemberAdd.js | 4 +- events/guildMemberRemove.js | 2 +- events/guildMemberUpdate.js | 2 +- events/messageCreate.js | 4 +- functions/checkCustomCommand.js | 2 +- functions/ensureGuildSettings.js | 2 +- functions/setupGuildOnJoin.js | 47 ++++---- languages/en-US.js | 106 ++++++++++-------- languages/en-dev.js | 8 +- languages/it.js | 18 +-- package.json | 8 +- slashs/Admin/announce.js | 2 +- slashs/Admin/poll.js | 2 +- slashs/Admin/reactionroles.js | 159 +++++++++++++-------------- slashs/Admin/usercounter.js | 12 +- slashs/Autovocal/autovocal_create.js | 5 +- slashs/Command/customcommand.js | 2 +- slashs/Command/customcommand_list.js | 2 +- slashs/Fun/achievement.js | 4 +- slashs/Games/akinator.js | 2 +- slashs/Games/connect4.js | 4 +- slashs/Games/flood.js | 2 +- slashs/Games/hangman.js | 6 +- slashs/Games/match.js | 4 +- slashs/Games/slotmachine.js | 6 +- slashs/Games/tictactoe.js | 16 +-- slashs/Info/serveremojis.js | 2 +- slashs/Moderation/kick.js | 2 +- slashs/Moderation/ticket.js | 7 +- slashs/Moderation/timeout.js | 4 +- slashs/Music/nowplaying.js | 4 +- slashs/Music/pause.js | 4 +- slashs/Music/play.js | 4 +- slashs/Music/queue.js | 4 +- slashs/Music/resume.js | 4 +- slashs/Music/skip.js | 4 +- slashs/Music/stop.js | 4 +- slashs/Music/summon.js | 4 +- slashs/Other/weather.js | 1 + slashs/Settings/setup.js | 18 +-- 41 files changed, 260 insertions(+), 238 deletions(-) diff --git a/chill.js b/chill.js index b1ddb84e..f480fc8d 100644 --- a/chill.js +++ b/chill.js @@ -1,6 +1,7 @@ const { Collection, Client, GatewayIntentBits, Partials } = require(`discord.js`); const client = new Client({ intents: [ + GatewayIntentBits.MessageContent, GatewayIntentBits.Guilds, GatewayIntentBits.GuildMembers, GatewayIntentBits.GuildBans, diff --git a/events/guildMemberAdd.js b/events/guildMemberAdd.js index c180829c..bddebcd3 100644 --- a/events/guildMemberAdd.js +++ b/events/guildMemberAdd.js @@ -3,14 +3,14 @@ module.exports = (client, member) => { if (client.settings.has(member.guild.id, `usercounter`)) client.chill.updateServerStats(client, member); // update server stats counter // welcome message const welcomechannel = member.guild.channels.cache.find(c => c.id === (client.settings.get(member.guild.id, `welcomechannel`))); - if (client.settings.get(member.guild.id, `welcomemessage`) === `true` && welcomechannel) { + if (client.settings.get(member.guild.id, `welcomemessage`) && welcomechannel) { welcomechannel.send({ embeds: [client.chill.welcomeMessage(client, member, member.guild)] }).catch(err => { return; }); } // role on join const roleonjoin = member.guild.roles.cache.find(r => r.id === client.settings.get(member.guild.id, `roleonjoin`)); - if (client.settings.get(member.guild.id, `welcomerole`) === `true` && roleonjoin && !member.guild.features.includes(`MEMBER_VERIFICATION_GATE_ENABLED`)) { + if (client.settings.get(member.guild.id, `welcomerole`) && roleonjoin && !member.guild.features.includes(`MEMBER_VERIFICATION_GATE_ENABLED`)) { member.roles.add(roleonjoin).catch(err => { return; }); diff --git a/events/guildMemberRemove.js b/events/guildMemberRemove.js index 74f35c11..e894094d 100644 --- a/events/guildMemberRemove.js +++ b/events/guildMemberRemove.js @@ -2,5 +2,5 @@ module.exports = (client, member) => { if (client.settings.has(member.guild.id, `xp.${member.id}`)) client.settings.delete(member.guild.id, `xp.${member.id}`); if (client.settings.has(member.guild.id, `usercounter`)) client.chill.updateServerStats(client, member); // update server stats counter const welcomechannel = member.guild.channels.cache.find(c => c.id === (client.settings.get(member.guild.id, `welcomechannel`))); - if (client.settings.get(member.guild.id, `welcomemessage`) === `true` && welcomechannel) welcomechannel.send({ embeds: [client.chill.welcomeMessage(client, member, member.guild, false)] }); + if (client.settings.get(member.guild.id, `welcomemessage`) && welcomechannel) welcomechannel.send({ embeds: [client.chill.welcomeMessage(client, member, member.guild, false)] }); }; \ No newline at end of file diff --git a/events/guildMemberUpdate.js b/events/guildMemberUpdate.js index a9dcfd39..461c6faf 100644 --- a/events/guildMemberUpdate.js +++ b/events/guildMemberUpdate.js @@ -2,7 +2,7 @@ module.exports = (client, oldUser, newUser) => { // give role on join after rules if guild is a community and has rules verification enabled if (newUser.guild.features.includes(`MEMBER_VERIFICATION_GATE_ENABLED`) && oldUser.pending === true && newUser.pending === false) { const roleonjoin = newUser.guild.roles.cache.find(r => r.id === client.settings.get(newUser.guild.id, `roleonjoin`)); - if (client.settings.get(newUser.guild.id, `welcomerole`) === `true` && roleonjoin) { + if (client.settings.get(newUser.guild.id, `welcomerole`) && roleonjoin) { newUser.roles.add(roleonjoin).catch(err => { return; }); diff --git a/events/messageCreate.js b/events/messageCreate.js index 38f77b7b..9c96437c 100644 --- a/events/messageCreate.js +++ b/events/messageCreate.js @@ -9,7 +9,7 @@ module.exports = async (client, msg) => { // mention bot if (msg.mentions.has(client.user) && !msg.content.includes(`@here`) && !msg.content.includes(`@everyone`)) msg.reply(LANG.bot_mention(msg.author)); // xp - if (client.settings.get(msg.guild.id, `xpmodule`) === `true` && msg.guild && !msg.content.startsWith(prefix) && !talkedRecently.has(msg.author.id) && msg.channel.id !== client.settings.get(msg.guild.id, `musictextchannel`)) { + if (client.settings.get(msg.guild.id, `xpmodule`) && msg.guild && !msg.content.startsWith(prefix) && !talkedRecently.has(msg.author.id) && msg.channel.id !== client.settings.get(msg.guild.id, `musictextchannel`)) { client.chill.xpAdd(client, msg, talkedRecently); } // old main @@ -24,7 +24,7 @@ module.exports = async (client, msg) => { if (command) { client.cmdstats.inc(`usage`, command.name); if (client.settings.includes(msg.guild.id, command.name, `disabledcommands`)) return msg.channel.send({ embeds: [client.chill.error(LANG.guild_disabled(command))] }).then(m => setTimeout(() => m.delete(), 5000)); // check if command is disabled on the guild - if (client.settings.get(msg.guild.id, `autodeletecmds`) === `true`) msg.delete(); + if (client.settings.get(msg.guild.id, `autodeletecmds`)) msg.delete(); command.run(client, msg, arg); } else { // custom command loader client.chill.checkCustomCommand(client, msg, cmd); diff --git a/functions/checkCustomCommand.js b/functions/checkCustomCommand.js index 9175b23c..1e85873c 100644 --- a/functions/checkCustomCommand.js +++ b/functions/checkCustomCommand.js @@ -7,7 +7,7 @@ const Discord = require(`discord.js`); */ module.exports = function(client, msg, cmd) { if (client.settings.has(msg.guild.id, `customcmd.${cmd}`)) { - if (client.settings.get(msg.guild.id, `autodeletecmds`) === `true`) msg.delete(); + if (client.settings.get(msg.guild.id, `autodeletecmds`)) msg.delete(); const customEmbed = new Discord.EmbedBuilder() .setColor(`Random`) .setDescription(client.settings.get(msg.guild.id, `customcmd.${cmd}`)); diff --git a/functions/ensureGuildSettings.js b/functions/ensureGuildSettings.js index e8629c84..8f6fbd79 100644 --- a/functions/ensureGuildSettings.js +++ b/functions/ensureGuildSettings.js @@ -30,7 +30,7 @@ module.exports = function(client, guild) { // other prefix: `.`, xpcooldown: 5, - lang: `en_US`, + lang: `en-US`, // array & objects autovocalchannels: [], autovocalcloned: [], diff --git a/functions/setupGuildOnJoin.js b/functions/setupGuildOnJoin.js index 70afdbaa..88e539a9 100644 --- a/functions/setupGuildOnJoin.js +++ b/functions/setupGuildOnJoin.js @@ -3,16 +3,19 @@ * @param {Object} guild @requires * @description creates deafult channels, roles, etc on guild join */ + +const { ChannelType } = require(`discord.js`); + module.exports = async function(client, guild) { - if (!guild.members.me.permissions.toArray().includes(`ADMINISTRATOR`)) return; - if (!guild.members.me.permissions.toArray().includes(`MANAGE_ROLES`) && !guild.members.me.permissions.toArray().includes(`MANAGE_CHANNELS`)) return; + if (!guild.members.me.permissions.toArray().includes(`Administrator`)) return; + if (!guild.members.me.permissions.toArray().includes(`ManageRoles`) && !guild.members.me.permissions.toArray().includes(`ManageChannels`)) return; // roles await guild.roles.create({ name: `Listening`, permissions: [], color: `CCCC00` }) .then(role => { client.settings.set(guild.id, role.id, `musictemprole`); }); - guild.roles.create({ name: `DJ`, permissions: [`CONNECT`], color: `D00091` }) + guild.roles.create({ name: `DJ`, permissions: [`Connect`], color: `D00091` }) .then(role => { client.settings.set(guild.id, role.id, `djrole`); }); @@ -20,63 +23,63 @@ module.exports = async function(client, guild) { .then(role => { client.settings.set(guild.id, role.id, `supportrole`); }); - guild.roles.create({ name: `Member`, permissions: [`VIEW_CHANNEL`], color: `33FFFF` }) + guild.roles.create({ name: `Member`, permissions: [`ViewChannel`], color: `33FFFF` }) .then(role => { client.settings.set(guild.id, role.id, `roleonjoin`); }); // channels - guild.channels.create(`🎫tickets`, { type: `GUILD_CATEGORY` }) + guild.channels.create(`🎫tickets`, { type: ChannelType.GuildCategory }) .then(channel => { client.settings.set(guild.id, channel.id, `ticketcategory`); }); - guild.channels.create(`👋welcome`, { type: `GUILD_TEXT`, + guild.channels.create(`👋welcome`, { type: ChannelType.GuildText, permissionOverwrites: [{ id: guild.roles.everyone.id, - deny: [`SEND_MESSAGES`, `SEND_TTS_MESSAGES`, `EMBED_LINKS`, `ATTACH_FILES`] }] }) + deny: [`SendMessages`, `SendTTSMessages`, `EmbedLinks`, `AttachFiles`] }] }) .then(channel => { client.settings.set(guild.id, channel.id, `welcomechannel`); }); - guild.channels.create(`📢announcements`, { type: `GUILD_TEXT`, + guild.channels.create(`📢announcements`, { type: ChannelType.GuildText, permissionOverwrites: [{ id: guild.roles.everyone.id, - deny: [`SEND_MESSAGES`, `SEND_TTS_MESSAGES`, `EMBED_LINKS`, `ATTACH_FILES`] }] }) + deny: [`SendMessages`, `SendTTSMessages`, `EmbedLinks`, `AttachFiles`] }] }) .then(channel => { client.settings.set(guild.id, channel.id, `bcchannel`); }); - guild.channels.create(`🔨punishments`, { type: `GUILD_TEXT`, + guild.channels.create(`🔨punishments`, { type: ChannelType.GuildText, permissionOverwrites: [{ id: guild.roles.everyone.id, - deny: [`SEND_MESSAGES`, `SEND_TTS_MESSAGES`, `EMBED_LINKS`, `ATTACH_FILES`] }] }) + deny: [`SendMessages`, `SendTTSMessages`, `EmbedLinks`, `AttachFiles`] }] }) .then(channel => { client.settings.set(guild.id, channel.id, `puchannel`); }); - guild.channels.create(`🚨reports`, { type: `GUILD_TEXT`, + guild.channels.create(`🚨reports`, { type: ChannelType.GuildText, permissionOverwrites: [{ id: guild.roles.everyone.id, - deny: [`VIEW_CHANNEL`] }] }) + deny: [`ViewChannel`] }] }) .then(channel => { client.settings.set(guild.id, channel.id, `reportchannel`); }); - guild.channels.create(`🎉giveaway`, { type: `GUILD_TEXT`, + guild.channels.create(`🎉giveaway`, { type: ChannelType.GuildText, permissionOverwrites: [{ id: guild.roles.everyone.id, - deny: [`SEND_MESSAGES`, `SEND_TTS_MESSAGES`, `EMBED_LINKS`, `ATTACH_FILES`] }] }) + deny: [`SendMessages`, `SendTTSMessages`, `EmbedLinks`, `AttachFiles`] }] }) .then(channel => { client.settings.set(guild.id, channel.id, `gachannel`); }); - guild.channels.create(`💡poll`, { type: `GUILD_TEXT`, + guild.channels.create(`💡poll`, { type: ChannelType.GuildText, permissionOverwrites: [{ id: guild.roles.everyone.id, - deny: [`SEND_MESSAGES`, `SEND_TTS_MESSAGES`, `EMBED_LINKS`, `ATTACH_FILES`] }] }) + deny: [`SendMessages`, `SendTTSMessages`, `EmbedLinks`, `AttachFiles`] }] }) .then(channel => { client.settings.set(guild.id, channel.id, `pollchannel`); }); - guild.channels.create(`🔊music`, { type: `GUILD_VOICE`, + guild.channels.create(`🔊music`, { type: ChannelType.GuildVoice, permissionOverwrites: [{ id: guild.roles.everyone.id, - deny: [`SPEAK`] }] }) + deny: [`Speak`] }] }) .then(channel => { client.settings.set(guild.id, channel.id, `musicvocalchannel`); }); - guild.channels.create(`🎵song-request`, { type: `GUILD_TEXT`, + guild.channels.create(`🎵song-request`, { type: ChannelType.GuildText, permissionOverwrites: [ { id: guild.id, - deny: [`VIEW_CHANNEL`] }, + deny: [`ViewChannel`] }, { id: client.settings.get(guild.id, `musictemprole`), - allow: [`VIEW_CHANNEL`, `SEND_MESSAGES`] }] }) + allow: [`ViewChannel`, `SendMessages`] }] }) .then(channel => { client.settings.set(guild.id, channel.id, `musictextchannel`); }); diff --git a/languages/en-US.js b/languages/en-US.js index bbb40de2..90677416 100644 --- a/languages/en-US.js +++ b/languages/en-US.js @@ -14,15 +14,15 @@ exports.commands = { `Yes.`, `Signs point to yes.`, `Reply hazy, try again.`, - `Ask again later`, + `Ask again later.`, `Better not tell you now.`, `Cannot predict now.`, - `Concentrate and ask again`, + `Concentrate and ask again.`, `Don't count on it.`, `My reply is no.`, `My sources say no.`, `Outlook not so good.`, - `Very doubtful`, + `Very doubtful.`, ], }, achievement: { @@ -45,7 +45,7 @@ exports.commands = { probably: `Probably`, probably_not: `Probably Not`, questions: `Questions`, - progress: (aki) => `Progress: ${aki.progress.toFixed(2)}%\n${`▬`.repeat((Math.round(aki.progress / 5))) + `🔘` + `▬`.repeat(20 - (Math.round(aki.progress / 5)))}`, + progress: (progress, progress_bar) => `Progress: ${progress}%\n${progress_bar}`, guessed_footer: (round) => `Guessed in ${round} rounds`, wp: `Well played!`, defeated: `You defeated me...`, @@ -69,7 +69,7 @@ exports.commands = { autovocal: { already_locked: `This Auto-Vocal channel is already locked.`, locked: `🔒Channel Locked`, - locked_description: `You can now invite other users to join this auto-vocal channel by doing \`.autovocalinvite @user\`.`, + locked_description: `You can now invite other users to join this auto-vocal channel by doing \`/autovocal invite @user\`.`, no_owner: `You don't have permission to lock or kick people!\nOnly the creator of this Auto-Vocal channel can.`, not_in_av: `You are not in an Auto-Vocal channel.`, already_whitelisted: (invited) => `${invited} is already whitelisted.`, @@ -137,22 +137,21 @@ exports.commands = { coin: [`Heads`, `Tails`], title: `Coin Flip`, flipping: `Flipping . . . `, - flipped: ` flipped **`, flipped: (member, result) => `${member} flipped **${result}**`, }, command: { - not_valid_command: (_command) => `\`${_command}\` is not a valid command. Check \`/help\` for a full list.`, - enabled: (command_name) => `✅ \`${command_name}\` has been enabled again on this server.`, - already_enabled: (_command) => `\`${_command}\` is already enabled on the server!`, - disabled: (command_name) => `❌ \`${command_name}\` has been disabled on this server.`, - already_disabled: (_command) => `\`${_command}\` is already disabled on the server.`, + not_valid_command: (command) => `\`${command}\` is not a valid command. Check \`/help\` for a full list.`, + enabled: (command) => `✅ \`${command}\` has been enabled again on this server.`, + already_enabled: (command) => `\`${command}\` is already enabled on the server!`, + disabled: (command) => `❌ \`${command}\` has been disabled on this server.`, + already_disabled: (command) => `\`${command}\` is already disabled on the server.`, no_commands: `There are no commands disabled on the server.`, disabled_commands: `Disabled Commands`, }, connect4: { title: `Connect 4`, react: `React to place a chip`, - won: (turn, p1, p2) => `${turn === `🔴` ? p1.displayName : p2.displayName} WON! 🏆`, + won: (winner) => `${winner} WON! 🏆`, draw: `DRAW! 😐`, turn: (player, turn) => `${player}'s Turn ${turn}`, inactivity: `Game stopped due to inactivity`, @@ -184,9 +183,11 @@ exports.commands = { emojifind: { no_result: (query) => `No result found for \`${query}\``, favourited_key: `Favourited`, - favourited_value: (faves) => `${faves} ${faves !== 1 ? `times` : `time`}`, + favourited_value_s: (faves) => `${faves} time`, + favourited_value_p: (faves) => `${faves} times`, animated_key: `Animated`, - animated_value: (category) => `${category == 8 ? `Yes` : `No`}`, + yes: `Yes`, + no: `No`, created: `✅ Successfully created a new emoji!`, add: `Add`, error: `An error occured while trying to create a new emoji. Are server emoji slots full?`, @@ -197,7 +198,7 @@ exports.commands = { won: `WON`, }, github: { - no_result: (username, repo) => `⛔ No result found for \`${username}\\${repo}\``, + no_result: (username, repo) => `No result found for \`${username}\\${repo}\``, stars: `⭐ Stars`, forks: `⤵️ Forks`, watchers: `👁️ Watchers`, @@ -218,9 +219,11 @@ exports.commands = { footer_start: (host_tag) => `Hosted by ${host_tag}\nAt`, success: (gachannel) => `✅ Giveaway started in ${gachannel}`, ended: `🎉 Giveaway Ended`, - winners_key: (winners) => `**${winners > 1 ? `Winners` : `Winner`}**`, - winners_value: (winner) => `**${winner == 0 ? `No Participants` : winner}**`, + winners_key_s: `**Winner**`, + winners_key_p: `**Winners**`, + no_participants: `No Participants`, footer_end: (host_tag) => `Hosted by ${host_tag}\nEnded at`, + footer_end_resumeInterval_fn: (oldtext) => `${oldtext}\nEnded at`, winner_msg: (winner, prize) => `**Congratulations ${winner}!\nYou won: \`${prize}\`**`, error: `I don't have permission to do this. Please check my permissions.`, }, @@ -228,8 +231,8 @@ exports.commands = { hangman: `Hangman`, player: `Player`, inactivity: `Game stopped due to inactivity!`, - won: (player, lastGuesser) => `\nCongratulations ${player || lastGuesser}! You won!`, - lost: (player, lastGuesser, word) => `\n${player || lastGuesser} lost!\nThe word was ${word}`, + won: (player) => `\nCongratulations ${player}! You won!`, + lost: (player, word) => `\n${player} lost!\nThe word was ${word}`, }, help: { title: `❓ Chill Bot HELP ❓`, @@ -242,15 +245,16 @@ exports.commands = { games: `🎮 Games`, info: `ℹ️ Info`, moderation: `🔨 Moderation`, + music: `🎵 Music`, other: `💡 Other`, owner: `⚙️ Owner`, roles: `🎚️ Roles`, settings: `💾 Settings`, xp: `🏆 Xp`, - cmd_description: (cmd) => `\n**Description**\n> ${cmd.description}`, - cmd_usage: (cmd) => `\n**Info**\n> ${cmd.usage}`, - cmd_userPerms: (cmd) => `\n\n**User Permissions**\n> \`${cmd.userPerms.join(`\`, \``)}\``, - cmd_botPerms: (cmd) => `\n\n**Bot Permissions**\n> \`${cmd.botPerms.join(`\`, \``)}\``, + cmd_description: (description) => `\n**Description**\n> ${description}`, + cmd_usage: (usage) => `\n**Info**\n> ${usage}`, + cmd_userPerms: (user_Perms) => `\n\n**User Permissions**\n> \`${user_Perms}\``, + cmd_botPerms: (bot_Perms) => `\n\n**Bot Permissions**\n> \`${bot_Perms}\``, }, kick: { no_channel: `mod-logs channel not found`, @@ -292,14 +296,14 @@ exports.commands = { }, nowplaying: { title: `🎵 Music`, - mco: (channel) => `Music Channel Only is active!\nYou can only use the music module in: <#${client.settings.get(interaction.guild.id, `musictextchannel`)}>.`, + mco: (channel) => `Music Channel Only is active!\nYou can only use the music module in: <#${channel}>.`, no_dj: `You don't have DJ role.`, no_playing: `There is nothing playing.`, not_vc: `You are not in a voice channel.`, }, pause: { title: `🎵 Music`, - mco: (channel) => `Music Channel Only is active!\nYou can only use the music module in: <#${client.settings.get(interaction.guild.id, `musictextchannel`)}>.`, + mco: (channel) => `Music Channel Only is active!\nYou can only use the music module in: <#${channel}>.`, no_dj: `You don't have DJ role.`, no_playing: `There is nothing playing.`, not_vc: `You are not in a voice channel.`, @@ -307,7 +311,7 @@ exports.commands = { }, percentage: { title: `Percentage`, - description: (x, y) => `${x} is **${(x / y * 100).toFixed(2)} %** of ${y}`, + description: (x, percentage, y) => `${x} is **${percentage} %** of ${y}`, error: (err) => `Error: ${err}`, }, ping: { @@ -315,13 +319,14 @@ exports.commands = { }, play: { title: `🎵 Music`, - mco: (channel) => `Music Channel Only is active!\nYou can only use the music module in: <#${client.settings.get(interaction.guild.id, `musictextchannel`)}>.`, + mco: (channel) => `Music Channel Only is active!\nYou can only use the music module in: <#${channel}>.`, no_dj: `You don't have DJ role.`, no_playing: `There is nothing playing.`, not_vc: `You are not in a voice channel.`, no_result: `I could not obtain any search result or the link provided was invalid.`, queue_limit: `You can't queue more than 10 songs.`, - playlist_queued: (pladded, plq) => `✅ ${pladded} songs from the playlist have been added to the queue${plq ? `\n⚠️ Some songs in the playlist were not added due to the queue limit` : ``}`, + playlist_queued: (pladded) => `✅ ${pladded} songs from the playlist have been added to the queue`, + playlist_trimmed: (pladded) => `✅ ${pladded} songs from the playlist have been added to the queue\n⚠️ Some songs in the playlist were not added due to the queue limit`, live: `LIVE`, queued: (song_title) => `✅ ${song_title} has been added to the queue`, by: (username) => `Requested by: ${username}`, @@ -379,7 +384,8 @@ exports.commands = { message_author: `Message author:`, message: `**Message:**`, preview: `Message Preview`, - char: (content) => `${content.slice(0, 1e3)}\n\`${(content.length - 1e3) > 1 ? `characters` : `character`}\``, + char: (content, exceeded) => `${content}\n\`+ ${exceeded} character\``, + chars: (content, exceeded) => `${content}\n\`+ ${exceeded} characters\``, }, Report: { // report context menu no_channel: `Reports channel not found`, @@ -396,7 +402,8 @@ exports.commands = { message_author: `Message author:`, message: `**Message:**`, preview: `Message Preview`, - char: (content) => `${content.slice(0, 1e3)}\n\`${(content.length - 1e3) > 1 ? `characters` : `character`}\``, + char: (content, exceeded) => `${content}\n\`+ ${exceeded} character\``, + chars: (content, exceeded) => `${content}\n\`+ ${exceeded} characters\``, }, resetconfig: { title: `💾Guild Settings`, @@ -441,7 +448,7 @@ exports.commands = { title: (size) => `Server Roles [${size}]`, }, say: { - sucess: `✅ Message correctly sent.`, + success: `✅ Message correctly sent.`, }, serveremojis: { no_emojis: `Server has no emojis`, @@ -449,9 +456,9 @@ exports.commands = { trimmed: `Some emojis are missing in this list due to Discord 4096 characters limit.`, }, serverinfo: { - filter_obj: { DISABLED: `Off`, MEMBERS_WITHOUT_ROLES: `No Role`, ALL_MEMBERS: `Everyone`, 0: `Off`, 1: `No Role`, 2: `Everyone` }, - verification_obj: { NONE: `None`, LOW: `Low`, MEDIUM: `Medium`, HIGH: `High`, VERY_HIGH: `Highest`, 0: `None`, 1: `Low`, 2: `Medium`, 3: `High`, 4: `Highest` }, - tier_obj: { NONE: `None`, TIER_1: `1`, TIER_2: `2`, TIER_3: `3` }, + filter_obj: { 0: `Off`, 1: `Without Role`, 2: `Everyone` }, + verification_obj: { 0: `None`, 1: `Low`, 2: `Medium`, 3: `High`, 4: `Highest` }, + tier_obj: { 0: `None`, 1: `1`, 2: `2`, 3: `3` }, // keep same string length inside each group // group1 text: `Text ::`, @@ -477,7 +484,7 @@ exports.commands = { setconfig: { title: `💾Guild Settings`, invalid_key: `Couldn't find that key! Do \`/showconfig\` to get key names`, - success: (config_key, value) => `**${config_key}** has been changed to: \`${value}\``, + success: (config_key, flag, value) => `**${config_key}** has been changed to: ${flag}\`${value}\``, }, setup: { title: `SETUP`, @@ -519,7 +526,8 @@ exports.commands = { }, slowmode: { title: `Slow-Mode`, - description: (delay, formatted_delay) => delay > 0 ? `Set to ${formatted_delay}` : `Disabled`, + set_to: (delay) => `Set to ${delay}`, + disabled: `Disabled`, }, stop: { title: `🎵 Music`, @@ -567,7 +575,8 @@ exports.commands = { reason: `Reason`, not_timed_out: (member) => `${member} is not currently timed out`, removed_title: `TIMEOUT REMOVED`, - description: (member, mode, puchannel) => `✅ ${member}${mode === `add` ? ` has been timed out` : `'s time out has been removed`} and logged in ${puchannel}`, + timeout_added: (member, puchannel) => `✅ ${member} has been timed out and logged in ${puchannel}`, + timeout_removed: (member, puchannel) => `✅ ${member}'s timeout has been removed and logged in ${puchannel}`, }, today: { boring_day: `*Nothing happened. Just a normal boring day...*`, @@ -588,7 +597,7 @@ exports.commands = { error: (err) => `Error: ${err}`, }, usercounter: { - already_enabled: (channel) => `Server Stats is already enabled and bound to ${channel}`, + already_enabled: (channel) => `User Counter is already enabled and bound to ${channel}`, channel_name: (memberCount) => `👥・${memberCount} users`, title: `User Counter`, enabled: (created) => `**✅ Enabled and bound to ${created}**`, @@ -632,7 +641,8 @@ exports.commands = { hierarchy: (role) => `I can't manage the role ${role} due to roles hierarchy.`, already: (member) => `${member} already has that role.`, not_yet: (member) => `${member} doesn't have that role.`, - success: (role, mode, member) => `✅ **${role}** has been ${mode === `give` ? `given to` : `taken from`} ${member}`, + role_given: (role, member) => `✅ **${role}** has been given to ${member}`, + role_taken: (role, member) => `✅ **${role}** has been taken from ${member}`, }, volume: { title: `🎵 Music`, @@ -652,7 +662,7 @@ exports.commands = { wind: `🌬️Wind`, humidity: `💧Humidity`, precipitations: `☔Precipitations`, - forecast: (f) => `**${f.skytextday}**\nLow: ${f.low} °C | ${Math.round(f.low * 1.8) + 32} °F\nHigh: ${f.high} °C | ${Math.round(f.high * 1.8) + 32} °F\nPrecipitations: ${f.precip.length > 0 ? f.precip : `0`}%`, + forecast: (skytext, low_c, low_f, high_c, high_f, precip) => `**${skytext}**\nLow: ${low_c} °C | ${low_f} °F\nHigh: ${high_c} °C | ${high_f} °F\nPrecipitations: ${precip}%`, /** * https://docs.microsoft.com/en-us/bingmaps/rest-services/common-parameters-and-types/supported-culture-codes * ^^^^ weather supported languages ^^^^ @@ -660,13 +670,15 @@ exports.commands = { */ }, xp: { - disabled: `⛔ This module is disabled on this server.`, - no_negative: `⛔ User experience can't go negative.`, + disabled: `This module is disabled on this server.`, + no_negative: `User experience can't go negative.`, set_to: `Set to`, author: (username) => `${username}'s experience`, - title: (xpmsg, pointsToAdd) => `${xpmsg} **${client.chill.fancyNumber(pointsToAdd)}** ${pointsToAdd > 1 || pointsToAdd == 0 ? `points` : `point`}`, + title_s: (xpmsg, points) => `${xpmsg} **${points}** point`, + title_p: (xpmsg, points) => `${xpmsg} **${points}** points`, by: (username) => `by ${username}`, - levelup_title: (xpmsg, pointsToAdd, newLevel) => `**${xpmsg} ${client.chill.fancyNumber(pointsToAdd)}** ${pointsToAdd > 1 || pointsToAdd == 0 ? `points` : `point`}\n*New level is: ${newLevel}*`, + levelup_s: (xpmsg, points, level) => `${xpmsg} **${points}** point\n*New level is: ${level}*`, + levelup_p: (xpmsg, points, level) => `${xpmsg} **${points}** points\n*New level is: ${level}*`, unlocked: (unlocked) => `***Unlocked roles:\n${unlocked}***`, taken: (unlocked) => `***Taken roles:\n${unlocked}***`, }, @@ -677,8 +689,10 @@ exports.events = { get_cmd_error: `An error occured while trying to execute that command.`, dev_disabled: (command_name) => `Command \`${command_name}\` has been temporarily disabled by the dev.`, dev_only: `This command is limited to the bot Developer!`, - user_perms: (command) => `You need the \`${command.userPerms.join(`\` \``)}\` permission${command.userPerms.length > 1 ? `s` : ``} to use this command!`, - bot_perms: (command, interaction) => `I need \`${command.botPerms.filter(perm => !interaction.guild.me.permissions.toArray().includes(perm)).join(`\` \``)}\` ${command.botPerms.length > 1 ? `permissionss` : `permission`} to use this command!`, + user_perms_s: (perm) => `You need the \`${perm}\` permission to use this command!`, + user_perms_p: (perms) => `You need the \`${perms}\` permissions to use this command!`, + bot_perms_s: (perm) => `I need the \`${perm}\` permission to use this command!`, + bot_perms_p: (perms) => `I need the \`${perms}\` permissions to use this command!`, guild_disabled: (command_name) => `\`${command_name}\` has been disabled on this server by an Administrator.`, error: (err) => `**ERROR:** ${err.message}`, }, diff --git a/languages/en-dev.js b/languages/en-dev.js index cd5e0ad4..90677416 100644 --- a/languages/en-dev.js +++ b/languages/en-dev.js @@ -69,7 +69,7 @@ exports.commands = { autovocal: { already_locked: `This Auto-Vocal channel is already locked.`, locked: `🔒Channel Locked`, - locked_description: `You can now invite other users to join this auto-vocal channel by doing \`.autovocalinvite @user\`.`, + locked_description: `You can now invite other users to join this auto-vocal channel by doing \`/autovocal invite @user\`.`, no_owner: `You don't have permission to lock or kick people!\nOnly the creator of this Auto-Vocal channel can.`, not_in_av: `You are not in an Auto-Vocal channel.`, already_whitelisted: (invited) => `${invited} is already whitelisted.`, @@ -456,9 +456,9 @@ exports.commands = { trimmed: `Some emojis are missing in this list due to Discord 4096 characters limit.`, }, serverinfo: { - filter_obj: { DISABLED: `Off`, MEMBERS_WITHOUT_ROLES: `Without Role`, ALL_MEMBERS: `Everyone`, 0: `Off`, 1: `Without Role`, 2: `Everyone` }, - verification_obj: { NONE: `None`, LOW: `Low`, MEDIUM: `Medium`, HIGH: `High`, VERY_HIGH: `Highest`, 0: `None`, 1: `Low`, 2: `Medium`, 3: `High`, 4: `Highest` }, - tier_obj: { NONE: `None`, TIER_1: `1`, TIER_2: `2`, TIER_3: `3` }, + filter_obj: { 0: `Off`, 1: `Without Role`, 2: `Everyone` }, + verification_obj: { 0: `None`, 1: `Low`, 2: `Medium`, 3: `High`, 4: `Highest` }, + tier_obj: { 0: `None`, 1: `1`, 2: `2`, 3: `3` }, // keep same string length inside each group // group1 text: `Text ::`, diff --git a/languages/it.js b/languages/it.js index 6c73902b..3be8c438 100644 --- a/languages/it.js +++ b/languages/it.js @@ -69,7 +69,7 @@ exports.commands = { autovocal: { already_locked: `Questo canale Auto-Vocale è già bloccato.`, locked: `🔒Canale Bloccato`, - locked_description: `Ora puoi invitare altri utenti a unirsi a questo canale Auto-Vocal facendo \`.autovocalinvite @user\`.`, + locked_description: `Ora puoi invitare altri utenti a unirsi a questo canale Auto-Vocal facendo \`/autovocal invite @user\`.`, no_owner: `Non hai il permesso di bloccare o cacciare le persone!\nSolo il creatore di questo canale Auto-Vocale può farlo.`, not_in_av: `Non sei in un canale Auto-Vocale.`, already_whitelisted: invited => `${invited} è già nella whitelist.`, @@ -450,19 +450,11 @@ exports.commands = { }, serverinfo: { filter_obj: { - DISABLED: `Spento`, - MEMBERS_WITHOUT_ROLES: `Senza Ruolo`, - ALL_MEMBERS: `Tutti`, 0: `Spento`, 1: `Senza Ruolo`, 2: `Tutti`, }, verification_obj: { - NONE: `Nessuno`, - LOW: `Basso`, - MEDIUM: `Medio`, - HIGH: `Alto`, - VERY_HIGH: `Massimo`, 0: `Nessuno`, 1: `Basso`, 2: `Medio`, @@ -470,10 +462,10 @@ exports.commands = { 4: `Massimo`, }, tier_obj: { - NONE: `Nessuno`, - TIER_1: `1`, - TIER_2: `2`, - TIER_3: `3`, + 0: `Nessuno`, + 1: `1`, + 2: `2`, + 3: `3`, }, // keep same string length inside each group // group1 diff --git a/package.json b/package.json index 89d8941b..6d263c09 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "dev": "nodemon --trace-deprecation --trace-warnings --trace-uncaught", "check": "ncu -x node-fetch", "update": "ncu -u -x node-fetch && npm install", + "docs": "node ./docs/generatedocs.js && cd docs && mkdocs build && echo New Updated Docs have been built!" }, "author": "mirko93s", "license": "Apache-2.0", @@ -22,7 +23,9 @@ "common-tags": "^1.8.2", "cpu-stat": "^2.0.1", "crypto-js": "^4.1.1", - "discord.js": "^14.0.1", + "dbd-dark-dashboard": "^1.6.491", + "discord-dashboard": "^2.3.40", + "discord.js": "^14.0.2", "enmap": "^5.9.0", "ffmpeg-static": "^5.0.2", "figlet": "^1.5.2", @@ -36,5 +39,8 @@ "ytdl-core": "^4.11.0", "ytpl": "^2.3.0", "ytsr": "^3.8.0" + }, + "devDependencies": { + "eslint": "^8.20.0" } } diff --git a/slashs/Admin/announce.js b/slashs/Admin/announce.js index 703240c6..434266b8 100644 --- a/slashs/Admin/announce.js +++ b/slashs/Admin/announce.js @@ -25,7 +25,7 @@ module.exports = { channelTypes: [Discord.ChannelType.GuildText, Discord.ChannelType.GuildNews], }, ], - run: async (client, interaction) => { + run: async (client, interaction, LANG) => { const title = interaction.options.getString(`title`); const description = interaction.options.getString(`description`); diff --git a/slashs/Admin/poll.js b/slashs/Admin/poll.js index 3bf9cb9f..00789861 100644 --- a/slashs/Admin/poll.js +++ b/slashs/Admin/poll.js @@ -58,7 +58,7 @@ module.exports = { .setDescription(LANG.description(choicemsg)) .setTimestamp(); - if (pollEmbed.description.length > 4096) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.choices_too_long)] }); + if (choicemsg > 4e3) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.choices_too_long)] }); pollchannel.send({ embeds: [pollEmbed] }).then(msg => { const doneEmbed = new Discord.EmbedBuilder() diff --git a/slashs/Admin/reactionroles.js b/slashs/Admin/reactionroles.js index ced7e0c6..36fca599 100644 --- a/slashs/Admin/reactionroles.js +++ b/slashs/Admin/reactionroles.js @@ -26,60 +26,28 @@ module.exports = { let row = new Discord.ActionRowBuilder().addComponents(confirmButton, abortButton); const rr = {}; - interaction.reply({ embeds: [rrEmbed], components: [row] }).then(() => { // send setup message - interaction.fetchReply().then(sent => { // fetch reply/msg from the interaction reply - const rrFilter = u => u.author.id === interaction.user.id; - const buttonFilter = i => { - i.deferUpdate(); - return i.user.id === interaction.user.id; - }; + interaction.reply({ embeds: [rrEmbed], components: [row], fetchReply: true }).then(sent => { // fetch reply/msg from the interaction reply + const rrFilter = u => u.author.id === interaction.user.id; + const buttonFilter = i => { + i.deferUpdate(); + return i.user.id === interaction.user.id; + }; - const rrCollector = interaction.channel.createMessageCollector({ filter: rrFilter, time: 60e3, errors: [`time`] }); - const buttonCollector = sent.createMessageComponentCollector({ filter: buttonFilter, componentType: Discord.ComponentType.Button, time: 60e3 }); + const rrCollector = interaction.channel.createMessageCollector({ filter: rrFilter, time: 60e3, errors: [`time`] }); + const buttonCollector = sent.createMessageComponentCollector({ filter: buttonFilter, componentType: Discord.ComponentType.Button, time: 60e3 }); - rrCollector.on(`collect`, async collected => { - collected.delete(); - rrCollector.resetTimer({ time: 60e3 }); - buttonCollector.resetTimer({ time: 60e3 }); - const emoji = getEmoji(collected.content); - const role = collected.mentions.roles.first(); - const description = collected.content.replace(/(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\u0023-\u0039]\ufe0f?\u20e3|\u3299|\u3297|\u303d|\u3030|\u24c2|\ud83c[\udd70-\udd71]|\ud83c[\udd7e-\udd7f]|\ud83c\udd8e|\ud83c[\udd91-\udd9a]|\ud83c[\udde6-\uddff]|[\ud83c[\ude01-\ude02]|\ud83c\ude1a|\ud83c\ude2f|[\ud83c[\ude32-\ude3a]|[\ud83c[\ude50-\ude51]|\u203c|\u2049|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|\u00a9|\u00ae|\u2122|\u2139|\ud83c\udc04|[\u2600-\u26FF]|\u2b05|\u2b06|\u2b07|\u2b1b|\u2b1c|\u2b50|\u2b55|\u231a|\u231b|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\ud83c\udccf|\u2934|\u2935|[\u2190-\u21ff])|<@&?\d+>/g, ``); - rrEmbed.fields = []; // clear embed fields in case there was an invalid emoji message - if (emoji.length === 1 && collected.mentions.roles.size === 1) { - try { // try to react to check if the emoji is supported by Discord - await sent.react(emoji[0].name); - } catch (err) { - rrEmbed.addFields([ - { - name: LANG.bad_input_key, - value: LANG.bad_input_value, - inline: false, - }, - ]); - return interaction.editReply({ embeds: [rrEmbed] }); - } - rr[`${emoji[0].name}`] = { - role: role.id, - description: description.trim(), - }; - rrEmbed.setDescription(rrEmbed.description + `\n> ${emoji[0].name} ${role}\n${description}`); - if (rrEmbed.description.length > 4096) { - rrEmbed.addFields([ - { - name: LANG.too_long_key, - value: LANG.too_long_value, - inline: false, - }, - ]); - return interaction.editReply({ embeds: [rrEmbed] }); - } - interaction.editReply({ embeds: [rrEmbed] }); // edit setup message adding new rrole - if (Object.keys(rr).length > 0) { - confirmButton.disabled = false; - row = new Discord.ActionRowBuilder().addComponents(confirmButton, abortButton); - interaction.editReply({ components: [row] }); - } - } else { + rrCollector.on(`collect`, async collected => { + collected.delete(); + rrCollector.resetTimer({ time: 60e3 }); + buttonCollector.resetTimer({ time: 60e3 }); + const emoji = getEmoji(collected.content); + const role = collected.mentions.roles.first(); + const description = collected.content.replace(/(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\u0023-\u0039]\ufe0f?\u20e3|\u3299|\u3297|\u303d|\u3030|\u24c2|\ud83c[\udd70-\udd71]|\ud83c[\udd7e-\udd7f]|\ud83c\udd8e|\ud83c[\udd91-\udd9a]|\ud83c[\udde6-\uddff]|[\ud83c[\ude01-\ude02]|\ud83c\ude1a|\ud83c\ude2f|[\ud83c[\ude32-\ude3a]|[\ud83c[\ude50-\ude51]|\u203c|\u2049|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|\u00a9|\u00ae|\u2122|\u2139|\ud83c\udc04|[\u2600-\u26FF]|\u2b05|\u2b06|\u2b07|\u2b1b|\u2b1c|\u2b50|\u2b55|\u231a|\u231b|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\ud83c\udccf|\u2934|\u2935|[\u2190-\u21ff])|<@&?\d+>/g, ``); + rrEmbed.fields = []; // clear embed fields in case there was an invalid emoji message + if (emoji.length === 1 && collected.mentions.roles.size === 1) { + try { // try to react to check if the emoji is supported by Discord + await sent.react(emoji[0].name); + } catch (err) { rrEmbed.addFields([ { name: LANG.bad_input_key, @@ -87,39 +55,70 @@ module.exports = { inline: false, }, ]); - interaction.editReply({ embeds: [rrEmbed] }); + return interaction.editReply({ embeds: [rrEmbed] }); } - }); + rr[`${emoji[0].name}`] = { + role: role.id, + description: description.trim(), + }; + rrEmbed.setDescription(rrEmbed.data.description + `\n> ${emoji[0].name} ${role}\n${description}`); - rrCollector.once(`end`, (collected, reason) => { - if (reason === `time`) { - rrEmbed.setDescription(client.chill.error(LANG.inactivity)).fields = []; - delete rrEmbed.footer; - interaction.editReply({ embeds: [rrEmbed], components: [] }); + if (rrEmbed.data.description.length > 4096) { + rrEmbed.addFields([ + { + name: LANG.too_long_key, + value: LANG.too_long_value, + inline: false, + }, + ]); + return interaction.editReply({ embeds: [rrEmbed] }); } - }); + interaction.editReply({ embeds: [rrEmbed] }); // edit setup message adding new rrole + if (Object.keys(rr).length > 0) { + confirmButton.data.disabled = false; + row = new Discord.ActionRowBuilder().addComponents(confirmButton, abortButton); + interaction.editReply({ components: [row] }); + } + } else { + rrEmbed.addFields([ + { + name: LANG.bad_input_key, + value: LANG.bad_input_value, + inline: false, + }, + ]); + interaction.editReply({ embeds: [rrEmbed] }); + } + }); + + rrCollector.once(`end`, (collected, reason) => { + if (reason === `time`) { + rrEmbed.setDescription(client.chill.error(LANG.inactivity)).fields = []; + delete rrEmbed.footer; + interaction.editReply({ embeds: [rrEmbed], components: [] }); + } + }); - buttonCollector.on(`collect`, collected => { - if (collected.customId == `confirm`) { - rrCollector.stop(); - buttonCollector.stop(); - let rolestext = ``; - for (const [emoji, data] of Object.entries(rr)) { - rolestext += `> ${emoji} ${interaction.guild.roles.cache.find(r => r.id === (data.role))}${data.description.length > 0 ? `\n*${data.description}*` : ``}\n`; - } - rrEmbed - .setDescription(LANG.react(rolestext)) - .fields = []; - delete rrEmbed.footer; - interaction.editReply({ embeds: [rrEmbed], components: [] }); // edit message with final embed - client.settings.set(interaction.guild.id, rr, `reactionroles.${sent.id}`); // save roles in db - } else if (collected.customId == `abort`) { - rrCollector.stop(); - buttonCollector.stop(); - interaction.deleteReply(); - return interaction.followUp({ ephemeral: true, embeds: [client.chill.error(LANG.aborted)], components: [] }); + buttonCollector.on(`collect`, collected => { + if (collected.customId == `confirm`) { + rrCollector.stop(); + buttonCollector.stop(); + let rolestext = ``; + for (const [emoji, data] of Object.entries(rr)) { + rolestext += `> ${emoji} ${interaction.guild.roles.cache.find(r => r.id === (data.role))}${data.description.length > 0 ? `\n*${data.description}*` : ``}\n`; } - }); + rrEmbed + .setDescription(LANG.react(rolestext)) + .fields = []; + delete rrEmbed.footer; + interaction.editReply({ embeds: [rrEmbed], components: [] }); // edit message with final embed + client.settings.set(interaction.guild.id, rr, `reactionroles.${sent.id}`); // save roles in db + } else if (collected.customId == `abort`) { + rrCollector.stop(); + buttonCollector.stop(); + interaction.deleteReply(); + return interaction.followUp({ ephemeral: true, embeds: [client.chill.error(LANG.aborted)], components: [] }); + } }); }); }, diff --git a/slashs/Admin/usercounter.js b/slashs/Admin/usercounter.js index d7adc324..2ac272b7 100644 --- a/slashs/Admin/usercounter.js +++ b/slashs/Admin/usercounter.js @@ -1,3 +1,4 @@ +const { PermissionFlagsBits, ChannelType } = require(`discord.js`); const Discord = require(`discord.js`); module.exports = { @@ -26,17 +27,18 @@ module.exports = { if (channel) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.already_enabled(channel))] }); let memberCount = interaction.guild.members.cache.filter(member => !member.user.bot).size; // filtering bots memberCount = client.chill.fancyNumber(memberCount); - interaction.guild.channels.create(LANG.channel_name(memberCount), { - type: Discord.ChannelType.GuildVoice, + interaction.guild.channels.create({ + name: LANG.channel_name(memberCount), + type: ChannelType.GuildVoice, permissionOverwrites: [ { id: interaction.guild.members.me.id, - allow: [`CONNECT`], + allow: [PermissionFlagsBits.Connect], }, { id: interaction.guild.roles.everyone.id, - deny: [`CONNECT`], - allow: [`ViewChannel`], + deny: [PermissionFlagsBits.Connect], + allow: [PermissionFlagsBits.ViewChannel], }, ], }).then(created => { diff --git a/slashs/Autovocal/autovocal_create.js b/slashs/Autovocal/autovocal_create.js index c10e7cd2..a6c6a120 100644 --- a/slashs/Autovocal/autovocal_create.js +++ b/slashs/Autovocal/autovocal_create.js @@ -8,7 +8,10 @@ module.exports = { options: null, run: async (client, interaction, LANG) => { - interaction.guild.channels.create(LANG.channel_name, { type: Discord.ChannelType.GuildVoice }).then(channel => { + interaction.guild.channels.create({ + name: LANG.channel_name, + type: Discord.ChannelType.GuildVoice, + }).then(channel => { client.settings.ensure(interaction.guild.id, defaultSettings); client.settings.push(interaction.guild.id, channel.id, `autovocalchannels`); const doneEmbed = new Discord.EmbedBuilder() diff --git a/slashs/Command/customcommand.js b/slashs/Command/customcommand.js index b2bbb25e..d89c785a 100644 --- a/slashs/Command/customcommand.js +++ b/slashs/Command/customcommand.js @@ -50,7 +50,7 @@ module.exports = { client.settings.set(interaction.guild.id, response, `customcmd.${command}`); const ccEmbed = new Discord.EmbedBuilder() .setColor(`Green`) - .setTitle(cLANG.title) + .setTitle(LANG.title) .setDescription(LANG.created(command, response)); interaction.reply({ embeds: [ccEmbed] }); } else if (interaction.options.getSubcommand() === `delete`) { diff --git a/slashs/Command/customcommand_list.js b/slashs/Command/customcommand_list.js index aa4305be..bd1407fa 100644 --- a/slashs/Command/customcommand_list.js +++ b/slashs/Command/customcommand_list.js @@ -21,7 +21,7 @@ module.exports = { for (const [key] of Object.entries(cmds)) { cmdmsg += (`\`${key}\` `); }; - if (cmdmsg.length <= 0) return interaction.reply({ ephemeral: true, embeds: [LANG.no_custom_commands] }); + if (cmdmsg.length <= 0) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.no_custom_commands)] }); const ccEmbed = new Discord.EmbedBuilder() .setColor(`Random`) .setTitle(LANG.title) diff --git a/slashs/Fun/achievement.js b/slashs/Fun/achievement.js index 613bdfa0..1736c2ad 100644 --- a/slashs/Fun/achievement.js +++ b/slashs/Fun/achievement.js @@ -13,7 +13,7 @@ module.exports = { }, { name: `icon`, - description: `Choose an icon`, + description: `Choose an icon. Defaults to "Grass"`, type: Discord.ApplicationCommandOptionType.Integer, choices: [ { name: `Grass`, value: 1 }, @@ -45,7 +45,7 @@ module.exports = { }, { name: `title`, - description: `Achievement title, max 25 characters`, + description: `Achievement title, max 25 characters. Defaults to "Achievement Unlocked!"`, type: Discord.ApplicationCommandOptionType.String, }, ], diff --git a/slashs/Games/akinator.js b/slashs/Games/akinator.js index b184bf59..c7a6ac92 100644 --- a/slashs/Games/akinator.js +++ b/slashs/Games/akinator.js @@ -124,7 +124,7 @@ module.exports = { sinceLastGuess++; round++; gameEmbed.setDescription(aki.question).setFooter({ text: LANG.progress(aki.progress.toFixed(2), (`▬`.repeat((Math.round(aki.progress / 5))) + `🔘` + `▬`.repeat(20 - (Math.round(aki.progress / 5))))) }); - gameEmbed.fields[0].value = round.toString(); + gameEmbed.data.fields[0].value = round.toString(); if ((aki.progress >= 80 && (hasGuessed === false || sinceLastGuess >= 5)) || aki.currentStep >= 78) { hasGuessed = true; sinceLastGuess = 0; diff --git a/slashs/Games/connect4.js b/slashs/Games/connect4.js index 04d60d2d..cb50ba23 100644 --- a/slashs/Games/connect4.js +++ b/slashs/Games/connect4.js @@ -76,10 +76,10 @@ module.exports = { return sent.edit({ embeds: [boardEmbed] }); } else if (turn == `🔴`) { turn = `🟡`; - boardEmbed.setAuthor({ name: LANG.turn(player, turn), iconURL: p2.displayAvatarURL() }); + boardEmbed.setAuthor({ name: LANG.turn(p2.displayName, turn), iconURL: p2.displayAvatarURL() }); } else { turn = `🔴`; - boardEmbed.setAuthor({ name: LANG.turn(player, turn), iconURL: p1.displayAvatarURL() }); + boardEmbed.setAuthor({ name: LANG.turn(p1.displayName, turn), iconURL: p1.displayAvatarURL() }); } return sent.edit({ embeds: [boardEmbed] }); }); diff --git a/slashs/Games/flood.js b/slashs/Games/flood.js index 1aee3fa6..a1e83db6 100644 --- a/slashs/Games/flood.js +++ b/slashs/Games/flood.js @@ -85,7 +85,7 @@ module.exports = { }); collector.on(`end`, (collected, reason) => { if (reason === `time`) gameEmbed.setTitle(LANG.inactivity); - if (reason === `won`) gameEmbed.setTitle(LANG.WON); + else if (reason === `won`) gameEmbed.setTitle(LANG.won); sent.edit({ embeds: [gameEmbed], components: [] }); }); }); diff --git a/slashs/Games/hangman.js b/slashs/Games/hangman.js index 98dbf5b4..af08a6c9 100644 --- a/slashs/Games/hangman.js +++ b/slashs/Games/hangman.js @@ -43,12 +43,12 @@ module.exports = { // create "footer" buttons leftButton = new Discord.ButtonBuilder() .setCustomId(`left`) - .setLabel(``) + .setLabel(` `) .setEmoji(`⬅️`) .setStyle(Discord.ButtonStyle.Secondary); rightButton = new Discord.ButtonBuilder() .setCustomId(`right`) - .setLabel(``) + .setLabel(` `) .setEmoji(`➡️`) .setStyle(Discord.ButtonStyle.Secondary); livesButton = new Discord.ButtonBuilder() @@ -85,7 +85,7 @@ module.exports = { const embed = new Discord.EmbedBuilder() .setColor(`Random`) - .setAuthor({ name: LANG.title }) + .setAuthor({ name: LANG.hangman }) .setTitle(guess.join(``)) .setDescription(`\`\`\`${ascii[7 - (lives + 1)]}\`\`\``); if (player) { diff --git a/slashs/Games/match.js b/slashs/Games/match.js index bba4bbf8..50d6652c 100644 --- a/slashs/Games/match.js +++ b/slashs/Games/match.js @@ -93,8 +93,8 @@ module.exports = { button[previousId].setStyle(Discord.ButtonStyle.Danger); sent.edit({ components: [row[0], row[1], row[2], row[3], row[4]] }); already = !already; - button[c.customId].setDisabled(false).setStyle(Discord.ButtonStyle.Secondary).setEmoji(); - button[previousId].setDisabled(false).setStyle(Discord.ButtonStyle.Secondary).setEmoji(); + button[c.customId].setDisabled(false).setStyle(Discord.ButtonStyle.Secondary).setEmoji({}); + button[previousId].setDisabled(false).setStyle(Discord.ButtonStyle.Secondary).setEmoji({}); } }); collector.on(`end`, (collected, reason) => { diff --git a/slashs/Games/slotmachine.js b/slashs/Games/slotmachine.js index 68f4e5cb..e4a80ca9 100644 --- a/slashs/Games/slotmachine.js +++ b/slashs/Games/slotmachine.js @@ -12,7 +12,7 @@ module.exports = { .setLabel(LANG.reroll) .setStyle(Discord.ButtonStyle.Primary); let row = new Discord.ActionRowBuilder().addComponents(spinButton); - interaction.reply({ embeds: [slot(interaction)], components: [row] }).then(() => { + interaction.reply({ embeds: [slot(interaction, LANG)], components: [row] }).then(() => { interaction.fetchReply().then(sent => { const filter = (_interaction) => { _interaction.deferUpdate(); @@ -48,11 +48,11 @@ function slot(interaction, LANG) { (slots[1] === slots[4] && slots[1] === slots[7] || slots[2] === slots[5] && slots[2] === slots[8] || slots[3] === slots[6] && slots[3] === slots[9]) || (slots[1] === slots[5] && slots[1] === slots[9] || slots[3] === slots[5] && slots[3] === slots[7])) { slotEmbed - .setFooter({ text: LANG.won(interaction.member) }) + .setFooter({ text: LANG.won(interaction.member.displayName) }) .setColor(`Green`); } else { slotEmbed - .setFooter({ text: LANG.lost(interaction.member) }) + .setFooter({ text: LANG.lost(interaction.member.displayName) }) .setColor(`Red`); } return slotEmbed; diff --git a/slashs/Games/tictactoe.js b/slashs/Games/tictactoe.js index 38c9db36..58813767 100644 --- a/slashs/Games/tictactoe.js +++ b/slashs/Games/tictactoe.js @@ -90,21 +90,21 @@ module.exports = { function checkWin(buttons) { for (let i = 0; i < 3; i++) { // horizontal - if (buttons[i * 3].emoji?.name === buttons[i * 3 + 1].emoji?.name && buttons[i * 3].emoji?.name === buttons[i * 3 + 2].emoji?.name) { - if (buttons[i * 3].emoji && buttons[i * 3 + 1].emoji && buttons[i * 3 + 2].emoji) return true; + if (buttons[i * 3].data.emoji?.name === buttons[i * 3 + 1].data.emoji?.name && buttons[i * 3].data.emoji?.name === buttons[i * 3 + 2].data.emoji?.name) { + if (buttons[i * 3].data.emoji && buttons[i * 3 + 1].data.emoji && buttons[i * 3 + 2].data.emoji) return true; } // vertical - if (buttons[i].emoji?.name === buttons[i + 3].emoji?.name && buttons[i].emoji?.name === buttons[i + 6].emoji?.name) { - if (buttons[i].emoji && buttons[i + 3].emoji && buttons[i + 6].emoji) return true; + if (buttons[i].data.emoji?.name === buttons[i + 3].data.emoji?.name && buttons[i].data.emoji?.name === buttons[i + 6].data.emoji?.name) { + if (buttons[i].data.emoji && buttons[i + 3].data.emoji && buttons[i + 6].data.emoji) return true; } } // ascending - if (buttons[0].emoji?.name === buttons[4].emoji?.name && buttons[0].emoji?.name === buttons[8].emoji?.name) { - if (buttons[0].emoji && buttons[4].emoji && buttons[8].emoji) return true; + if (buttons[0].data.emoji?.name === buttons[4].data.emoji?.name && buttons[0].data.emoji?.name === buttons[8].data.emoji?.name) { + if (buttons[0].data.emoji && buttons[4].data.emoji && buttons[8].data.emoji) return true; } // descending - if (buttons[2].emoji?.name === buttons[4].emoji?.name && buttons[2].emoji?.name === buttons[6].emoji?.name) { - if (buttons[2].emoji && buttons[4].emoji && buttons[6].emoji) return true; + if (buttons[2].data.emoji?.name === buttons[4].data.emoji?.name && buttons[2].data.emoji?.name === buttons[6].data.emoji?.name) { + if (buttons[2].data.emoji && buttons[4].data.emoji && buttons[6].data.emoji) return true; } return false; } diff --git a/slashs/Info/serveremojis.js b/slashs/Info/serveremojis.js index a8c8d3b4..174571e5 100644 --- a/slashs/Info/serveremojis.js +++ b/slashs/Info/serveremojis.js @@ -8,7 +8,7 @@ module.exports = { const emojiEmbed = new Discord.EmbedBuilder() .setColor(`Random`) - .setTitle(cLANG.title); + .setTitle(LANG.title); let emojis = await interaction.guild.emojis.cache.map((e) => `${e}`).join(` `).toString(); if (emojis.length < 1) { diff --git a/slashs/Moderation/kick.js b/slashs/Moderation/kick.js index faa8e8b7..4ea8089c 100644 --- a/slashs/Moderation/kick.js +++ b/slashs/Moderation/kick.js @@ -46,7 +46,7 @@ module.exports = { { name: LANG.by, value: interaction.member.user.username, - inline: tr, + inline: true, }, { name: LANG.reason, diff --git a/slashs/Moderation/ticket.js b/slashs/Moderation/ticket.js index 3d11af0f..253211be 100644 --- a/slashs/Moderation/ticket.js +++ b/slashs/Moderation/ticket.js @@ -26,9 +26,9 @@ module.exports = { ], run: async (client, interaction, LANG) => { - if (interaction.options.getSubcommand() === `create`) { + const langPrefix = LANG.channel_prefix; - const langPrefix = LANG.channel_prefix; + if (interaction.options.getSubcommand() === `create`) { const ticketalready = interaction.guild.channels.cache.find(c => c.name === `${langPrefix}-${interaction.user.username}`); if (ticketalready) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.already_opened_ticket)] }); @@ -36,7 +36,8 @@ module.exports = { const category = interaction.guild.channels.cache.find(c => c.id === (client.settings.get(interaction.guild.id, `ticketcategory`)))?.id || null; const supportrole = interaction.guild.roles.cache.find(r => r.id === (client.settings.get(interaction.guild.id, `supportrole`)))?.id || null; - interaction.guild.channels.create(`${langPrefix}-${interaction.user.username}`, { + interaction.guild.channels.create({ + name: `${langPrefix}-${interaction.user.username}`, type: Discord.ChannelType.GuildText, parent: category, permissionOverwrites: [ diff --git a/slashs/Moderation/timeout.js b/slashs/Moderation/timeout.js index b89572a2..41a9236c 100644 --- a/slashs/Moderation/timeout.js +++ b/slashs/Moderation/timeout.js @@ -97,7 +97,7 @@ module.exports = { const timedoutEmbed = new Discord.EmbedBuilder() .setColor(`Yellow`) .setThumbnail(user.user.displayAvatarURL()) - .setTitle(LANG.title) + .setTitle(LANG.timeout_title) .setDescription(user.user.tag) .addFields([ { @@ -123,7 +123,7 @@ module.exports = { .setColor(`Random`) .setDescription(LANG.not_timed_out(user)); if (!user.isCommunicationDisabled()) return interaction.reply({ ephemeral: true, embeds: [notTimedoutEmbed] }); - user.timeout(0, reason).catch(err => { + user.timeout(null, reason).catch(err => { if (err) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.error(err))] }); }); const removedEmbed = new Discord.EmbedBuilder() diff --git a/slashs/Music/nowplaying.js b/slashs/Music/nowplaying.js index 9de65bec..017a2798 100644 --- a/slashs/Music/nowplaying.js +++ b/slashs/Music/nowplaying.js @@ -8,8 +8,8 @@ module.exports = { const serverQueue = client.queue.get(interaction.guild.id); - if (!interaction.member.roles.cache.some(role => role.id === (client.settings.get(interaction.guild.id, `djrole`))) && client.settings.get(interaction.guild.id, `djrequired`) === `true`) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.no_dj)] }); - if (client.settings.get(interaction.guild.id, `musicchannelonly`) === `true` && interaction.channel.id !== client.settings.get(interaction.guild.id, `musictextchannel`)) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.mco(client.settings.get(interaction.guild.id, `musictextchannel`)))] }); + if (!interaction.member.roles.cache.some(role => role.id === (client.settings.get(interaction.guild.id, `djrole`))) && client.settings.get(interaction.guild.id, `djrequired`)) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.no_dj)] }); + if (client.settings.get(interaction.guild.id, `musicchannelonly`) && interaction.channel.id !== client.settings.get(interaction.guild.id, `musictextchannel`)) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.mco(client.settings.get(interaction.guild.id, `musictextchannel`)))] }); if (!interaction.member.voice.channel) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.not_vc)] }); if (!serverQueue) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.no_playing)] }); diff --git a/slashs/Music/pause.js b/slashs/Music/pause.js index c20eb5b5..f947adbf 100644 --- a/slashs/Music/pause.js +++ b/slashs/Music/pause.js @@ -7,8 +7,8 @@ module.exports = { run: async (client, interaction, LANG) => { const serverQueue = client.queue.get(interaction.guild.id); - if (!interaction.member.roles.cache.some(role => role.id === (client.settings.get(interaction.guild.id, `djrole`))) && client.settings.get(interaction.guild.id, `djrequired`) === `true`) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.no_dj)] }); - if (client.settings.get(interaction.guild.id, `musicchannelonly`) === `true` && interaction.channel.id !== client.settings.get(interaction.guild.id, `musictextchannel`)) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.mco(client.settings.get(interaction.guild.id, `musictextchannel`)))] }); + if (!interaction.member.roles.cache.some(role => role.id === (client.settings.get(interaction.guild.id, `djrole`))) && client.settings.get(interaction.guild.id, `djrequired`)) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.no_dj)] }); + if (client.settings.get(interaction.guild.id, `musicchannelonly`) && interaction.channel.id !== client.settings.get(interaction.guild.id, `musictextchannel`)) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.mco(client.settings.get(interaction.guild.id, `musictextchannel`)))] }); if (!interaction.member.voice.channel) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.not_vc)] }); if (serverQueue && serverQueue.playing) { serverQueue.playing = false; diff --git a/slashs/Music/play.js b/slashs/Music/play.js index 8971d94c..3f7d737c 100644 --- a/slashs/Music/play.js +++ b/slashs/Music/play.js @@ -30,8 +30,8 @@ module.exports = { const searchString = arg; const url = arg.replace(/<(.+)>/g, `$1`); - if (!interaction.member.roles.cache.some(role => role.id === (client.settings.get(interaction.guild.id, `djrole`))) && client.settings.get(interaction.guild.id, `djrequired`) === `true`) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.no_dj)] }); - if (client.settings.get(interaction.guild.id, `musicchannelonly`) === `true` && interaction.channel.id !== client.settings.get(interaction.guild.id, `musictextchannel`)) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.mco(client.settings.get(interaction.guild.id, `musictextchannel`)))] }); + if (!interaction.member.roles.cache.some(role => role.id === (client.settings.get(interaction.guild.id, `djrole`))) && client.settings.get(interaction.guild.id, `djrequired`)) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.no_dj)] }); + if (client.settings.get(interaction.guild.id, `musicchannelonly`) && interaction.channel.id !== client.settings.get(interaction.guild.id, `musictextchannel`)) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.mco(client.settings.get(interaction.guild.id, `musictextchannel`)))] }); const voiceChannel = interaction.member.voice.channel; if (!voiceChannel) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.not_vc)] }); // queue limit diff --git a/slashs/Music/queue.js b/slashs/Music/queue.js index f4ec4ec6..397a08ee 100644 --- a/slashs/Music/queue.js +++ b/slashs/Music/queue.js @@ -6,9 +6,9 @@ module.exports = { options: null, run: async (client, interaction, LANG) => { - if (!interaction.member.roles.cache.some(role => role.id === (client.settings.get(interaction.guild.id, `djrole`))) && client.settings.get(interaction.guild.id, `djrequired`) === `true`) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.no_dj)] }); + if (!interaction.member.roles.cache.some(role => role.id === (client.settings.get(interaction.guild.id, `djrole`))) && client.settings.get(interaction.guild.id, `djrequired`)) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.no_dj)] }); const serverQueue = client.queue.get(interaction.guild.id); - if (client.settings.get(interaction.guild.id, `musicchannelonly`) === `true` && interaction.channel.id !== client.settings.get(interaction.guild.id, `musictextchannel`)) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.mco(client.settings.get(interaction.guild.id, `musictextchannel`)))] }); + if (client.settings.get(interaction.guild.id, `musicchannelonly`) && interaction.channel.id !== client.settings.get(interaction.guild.id, `musictextchannel`)) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.mco(client.settings.get(interaction.guild.id, `musictextchannel`)))] }); if (!interaction.member.voice.channel) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.not_vc)] }); if (!serverQueue) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.no_playing)] }); diff --git a/slashs/Music/resume.js b/slashs/Music/resume.js index 78f8a215..cade6d84 100644 --- a/slashs/Music/resume.js +++ b/slashs/Music/resume.js @@ -6,9 +6,9 @@ module.exports = { options: null, run: async (client, interaction, LANG) => { - if (!interaction.member.roles.cache.some(role => role.id === (client.settings.get(interaction.guild.id, `djrole`))) && client.settings.get(interaction.guild.id, `djrequired`) === `true`) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.no_dj)] }); + if (!interaction.member.roles.cache.some(role => role.id === (client.settings.get(interaction.guild.id, `djrole`))) && client.settings.get(interaction.guild.id, `djrequired`)) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.no_dj)] }); const serverQueue = client.queue.get(interaction.guild.id); - if (client.settings.get(interaction.guild.id, `musicchannelonly`) === `true` && interaction.channel.id !== client.settings.get(interaction.guild.id, `musictextchannel`)) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.mco(client.settings.get(interaction.guild.id, `musictextchannel`)))] }); + if (client.settings.get(interaction.guild.id, `musicchannelonly`) && interaction.channel.id !== client.settings.get(interaction.guild.id, `musictextchannel`)) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.mco(client.settings.get(interaction.guild.id, `musictextchannel`)))] }); if (!interaction.member.voice.channel) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.not_vc)] }); if (serverQueue && !serverQueue.playing) { serverQueue.playing = true; diff --git a/slashs/Music/skip.js b/slashs/Music/skip.js index 91dc1e8b..86d0dc81 100644 --- a/slashs/Music/skip.js +++ b/slashs/Music/skip.js @@ -6,9 +6,9 @@ module.exports = { options: null, run: async (client, interaction, LANG) => { - if (!interaction.member.roles.cache.some(role => role.id === (client.settings.get(interaction.guild.id, `djrole`))) && client.settings.get(interaction.guild.id, `djrequired`) === `true`) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.no_dj)] }); + if (!interaction.member.roles.cache.some(role => role.id === (client.settings.get(interaction.guild.id, `djrole`))) && client.settings.get(interaction.guild.id, `djrequired`)) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.no_dj)] }); const serverQueue = client.queue.get(interaction.guild.id); - if (client.settings.get(interaction.guild.id, `musicchannelonly`) === `true` && interaction.channel.id !== client.settings.get(interaction.guild.id, `musictextchannel`)) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.mco(client.settings.get(interaction.guild.id, `musictextchannel`)))] }); + if (client.settings.get(interaction.guild.id, `musicchannelonly`) && interaction.channel.id !== client.settings.get(interaction.guild.id, `musictextchannel`)) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.mco(client.settings.get(interaction.guild.id, `musictextchannel`)))] }); if (!interaction.member.voice.channel) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.not_vc)] }); if (!serverQueue) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.no_playing)] }); diff --git a/slashs/Music/stop.js b/slashs/Music/stop.js index be8b3476..96089418 100644 --- a/slashs/Music/stop.js +++ b/slashs/Music/stop.js @@ -7,8 +7,8 @@ module.exports = { options: null, run: async (client, interaction, LANG) => { - if (!interaction.member.roles.cache.some(role => role.id === (client.settings.get(interaction.guild.id, `djrole`))) && client.settings.get(interaction.guild.id, `djrequired`) === `true`) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.no_dj)] }); - if (client.settings.get(interaction.guild.id, `musicchannelonly`) === `true` && interaction.channel.id !== client.settings.get(interaction.guild.id, `musictextchannel`)) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.mco(client.settings.get(interaction.guild.id, `musictextchannel`)))] }); + if (!interaction.member.roles.cache.some(role => role.id === (client.settings.get(interaction.guild.id, `djrole`))) && client.settings.get(interaction.guild.id, `djrequired`)) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.no_dj)] }); + if (client.settings.get(interaction.guild.id, `musicchannelonly`) && interaction.channel.id !== client.settings.get(interaction.guild.id, `musictextchannel`)) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.mco(client.settings.get(interaction.guild.id, `musictextchannel`)))] }); if (!interaction.member.voice.channel) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.not_vc)] }); if (getVoiceConnection(interaction.guild.id)) { client.queue.get(interaction.guild.id).songs = []; diff --git a/slashs/Music/summon.js b/slashs/Music/summon.js index b6d4992b..a11318c4 100644 --- a/slashs/Music/summon.js +++ b/slashs/Music/summon.js @@ -8,8 +8,8 @@ module.exports = { options: null, run: async (client, interaction, LANG) => { - if (!interaction.member.roles.cache.some(role => role.id === (client.settings.get(interaction.guild.id, `djrole`))) && client.settings.get(interaction.guild.id, `djrequired`) === `true`) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.no_dj)] }); - if (client.settings.get(interaction.guild.id, `musicchannelonly`) === `true` && interaction.channel.id !== client.settings.get(interaction.guild.id, `musictextchannel`)) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.mco(client.settings.get(interaction.guild.id, `musictextchannel`)))] }); + if (!interaction.member.roles.cache.some(role => role.id === (client.settings.get(interaction.guild.id, `djrole`))) && client.settings.get(interaction.guild.id, `djrequired`)) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.no_dj)] }); + if (client.settings.get(interaction.guild.id, `musicchannelonly`) && interaction.channel.id !== client.settings.get(interaction.guild.id, `musictextchannel`)) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.mco(client.settings.get(interaction.guild.id, `musictextchannel`)))] }); if (!interaction.member.voice.channel) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.not_vc)] }); joinVoiceChannel({ diff --git a/slashs/Other/weather.js b/slashs/Other/weather.js index 8d6964c5..44ca7e51 100644 --- a/slashs/Other/weather.js +++ b/slashs/Other/weather.js @@ -21,6 +21,7 @@ module.exports = { degreeType: `C`, lang: `en_US`, }, function(err, result) { + console.log(result); if (result === undefined || result.length === 0 || err) return interaction.reply({ ephemeral: true, embeds: [client.chill.error(LANG.no_location)] }); const current = result[0].current; const embed = new Discord.EmbedBuilder() diff --git a/slashs/Settings/setup.js b/slashs/Settings/setup.js index e6c020c0..4f514d65 100644 --- a/slashs/Settings/setup.js +++ b/slashs/Settings/setup.js @@ -29,7 +29,7 @@ module.exports = { const already = `❌`; // categories if (!ticketcategory) { - interaction.guild.channels.create(`🎫tickets`, { type: Discord.ChannelType.GuildCategory }) + interaction.guild.channels.create({ name: `🎫tickets`, type: Discord.ChannelType.GuildCategory }) .then(channel => { client.settings.set(interaction.guild.id, channel.id, `ticketcategory`); }); @@ -77,7 +77,7 @@ module.exports = { }; // channels if (!welcomechannel) { - interaction.guild.channels.create(`👋welcome`, { type: Discord.ChannelType.GuildText, + interaction.guild.channels.create({ name: `👋welcome`, type: Discord.ChannelType.GuildText, permissionOverwrites: [{ id: interaction.guild.roles.everyone.id, deny: [`SendMessages`, `SendTTSMessages`, `EmbedLinks`, `AttachFiles`] }] }) .then(channel => { @@ -88,7 +88,7 @@ module.exports = { welcomemsg = already; }; if (!bcchannel) { - interaction.guild.channels.create(`🔴broadcast`, { type: Discord.ChannelType.GuildText, + interaction.guild.channels.create({ name: `🔴broadcast`, type: Discord.ChannelType.GuildText, permissionOverwrites: [{ id: interaction.guild.roles.everyone.id, deny: [`SendMessages`, `SendTTSMessages`, `EmbedLinks`, `AttachFiles`] }] }) .then(channel => { @@ -99,7 +99,7 @@ module.exports = { bcmsg = already; }; if (!puchannel) { - interaction.guild.channels.create(`🔨punishments`, { type: Discord.ChannelType.GuildText, + interaction.guild.channels.create({ name: `🔨punishments`, type: Discord.ChannelType.GuildText, permissionOverwrites: [{ id: interaction.guild.roles.everyone.id, deny: [`SendMessages`, `SendTTSMessages`, `EmbedLinks`, `AttachFiles`] }] }) .then(channel => { @@ -110,7 +110,7 @@ module.exports = { pumsg = already; }; if (!reportchannel) { - interaction.guild.channels.create(`🚨reports`, { type: Discord.ChannelType.GuildText, + interaction.guild.channels.create({ name: `🚨reports`, type: Discord.ChannelType.GuildText, permissionOverwrites: [{ id: interaction.guild.roles.everyone.id, deny: [`ViewChannel`] }] }) .then(channel => { @@ -121,7 +121,7 @@ module.exports = { reportmsg = already; }; if (!gachannel) { - interaction.guild.channels.create(`🎉giveaway`, { type: Discord.ChannelType.GuildText, + interaction.guild.channels.create({ name: `🎉giveaway`, type: Discord.ChannelType.GuildText, permissionOverwrites: [{ id: interaction.guild.roles.everyone.id, deny: [`SendMessages`, `SendTTSMessages`, `EmbedLinks`, `AttachFiles`] }] }) .then(channel => { @@ -132,7 +132,7 @@ module.exports = { gamsg = already; }; if (!pollchannel) { - interaction.guild.channels.create(`💡poll`, { type: Discord.ChannelType.GuildText, + interaction.guild.channels.create({ name: `💡poll`, type: Discord.ChannelType.GuildText, permissionOverwrites: [{ id: interaction.guild.roles.everyone.id, deny: [`SendMessages`, `SendTTSMessages`, `EmbedLinks`, `AttachFiles`] }] }) .then(channel => { @@ -143,7 +143,7 @@ module.exports = { pollmsg = already; }; if (!musicvocalchannel) { - interaction.guild.channels.create(`🔊music`, { type: Discord.ChannelType.GuildVoice, + interaction.guild.channels.create({ name: `🔊music`, type: Discord.ChannelType.GuildVoice, permissionOverwrites: [{ id: interaction.guild.roles.everyone.id, deny: [`Speak`] }] }) .then(channel => { @@ -154,7 +154,7 @@ module.exports = { musicvocalmsg = already; }; if (!musictextchannel) { - interaction.guild.channels.create(`🎵song-request`, { type: Discord.ChannelType.GuildText, + interaction.guild.channels.create({ name: `🎵song-request`, type: Discord.ChannelType.GuildText, permissionOverwrites: [ { id: interaction.guild.roles.everyone.id, deny: [`ViewChannel`] },