diff --git a/plugins/commands.js b/plugins/commands.js index eddd492..796ee53 100644 --- a/plugins/commands.js +++ b/plugins/commands.js @@ -47,8 +47,8 @@ function inject(bot, dcclient) { // try catch cuz TypeError: Cannot read properties of undefined (reading 'replace') try { const usernameraw = username.replace(/§[a-f0-9rlonmk]/g, '').replace(/§/g, ''); - var sender = bot.playersAddedPlayers[usernameraw] - var username = bot.getplayerusername[usernameraw]; + var sender = bot.playersAddedPlayers[usernameraw]; + var username = bot.getplayerusername[sender]; var message = message.replace(/§[a-f0-9rlonmk]/g, '').replace(/§/g, ''); bot.command_handler.run(username, usernameraw, message, sender); } catch (e) {