diff --git a/plugins/commands.js b/plugins/commands.js index afb326c..53f8994 100644 --- a/plugins/commands.js +++ b/plugins/commands.js @@ -1,3 +1,4 @@ +/* eslint-disable require-jsdoc */ /* eslint-disable max-len */ const path = require('path'); const {MessageEmbed} = require('discord.js'); @@ -47,23 +48,23 @@ function inject(bot, dcclient, config) { bot.command_handler.main(prefix, username, usernameraw, message, sender, channeldc); } }; - bot.on('message', async (usernamee, messagee, senderr) => { + bot.on('message', async (_username, _message, _sender) => { // try catch cuz TypeError: Cannot read properties of undefined (reading 'replace') try { - const usernameraw = usernamee.replace(/§[a-f0-9rlonmk]/g, '').replace(/§/g, ''); - const sender = bot.options.host === 'sus.shhnowisnottheti.me' && senderr !== '00000000-0000-0000-0000-000000000000' ? senderr : bot.playersAddedPlayers[usernameraw]; + const usernameraw = _username.replace(/§[a-f0-9rlonmk]/g, '').replace(/§/g, ''); + const sender = bot.options.host === 'sus.shhnowisnottheti.me' && _sender !== '00000000-0000-0000-0000-000000000000' ? _sender : bot.playersAddedPlayers[usernameraw]; let username; if (!bot.getplayerusername[sender]) username = usernameraw; else username = bot.getplayerusername[sender]; - const message = messagee.replace(/* /§r/g */ /§[a-f0-9rlonmk]/g, '')/* .replace(/§/g, '')*/; + const message = _message.replace(/* /§r/g */ /§[a-f0-9rlonmk]/g, '')/* .replace(/§/g, '')*/; bot.command_handler.run(username, usernameraw, message, sender); } catch (e) { bot.console.error(e); } }); - bot.on('cspy', async function(usernamee, messagee) { - const username = usernamee.replace(/§[a-f0-9rlonmk]/g, '').replace(/§/g, ''); - const message = messagee.replace(/§[a-f0-9rlonmk]/g, '').replace(/§/g, ''); + bot.on('cspy', async function(_username, _message) { + const username = _username.replace(/§[a-f0-9rlonmk]/g, '').replace(/§/g, ''); + const message = _message.replace(/§[a-f0-9rlonmk]/g, '').replace(/§/g, ''); const sender = bot.playersAddedPlayers[username]; bot.command_handler.run(username, username, message, sender); });