mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-14 10:44:55 -05:00
don't run commands when sender is undefined
This commit is contained in:
parent
3767f4c053
commit
97c66474f7
2 changed files with 2 additions and 1 deletions
|
@ -9,6 +9,6 @@ module.exports = {
|
|||
execute: function(bot, username, usernameraw, sender, prefix, args) {
|
||||
const rtppos = `${between(20000000, 500000)} 100 ${between(20000000, 500000)}`;
|
||||
bot.core.run('minecraft:tellraw @a ' + JSON.stringify([{text: 'Teleporting ', color: 'white'}, {text: username, color: 'aqua'}, {text: ' to ', color: 'white'}, {text: rtppos, color: 'green'}, {text: '...', color: 'white'}]));
|
||||
bot.core.run(`minecraft:execute unless entity @s[name= run ] run tp ${username} ${rtppos}`);
|
||||
bot.core.run(`essentials:teleport ${sender} ${rtppos}`);
|
||||
},
|
||||
};
|
||||
|
|
|
@ -50,6 +50,7 @@ function inject(bot, dcclient) {
|
|||
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];
|
||||
if (!sender) return;
|
||||
const username = bot.getplayerusername[sender];
|
||||
const message = messagee.replace(/§r/g /* /§[a-f0-9rlonmk]/g */, '')/* .replace(/§/g, '')*/;
|
||||
bot.command_handler.run(username, usernameraw, message, sender);
|
||||
|
|
Loading…
Reference in a new issue