Added message user object fallback.

This commit is contained in:
ThePendulum 2021-11-15 20:54:00 +01:00
parent 98eda1879b
commit fbd898d2ee
2 changed files with 2 additions and 2 deletions

View File

@ -12,7 +12,7 @@ module.exports = {
avatar: 'https://i.imgur.com/IZwrjjG.png',
},
operators: ['admin'],
uniqueUsername: true,
uniqueUsername: false,
socket: 'ws://127.0.0.1:3000/socket',
api: 'http://127.0.0.1:3000/api',
reconnectDelay: 10, // seconds

View File

@ -136,7 +136,7 @@ function onLeave(data, bot) {
function onMessage(message, bot, games) {
const [, command, subcommand] = message.body?.match(new RegExp(`^${config.prefix}(\\w+)(?:\\:(\\w+))?`)) || [];
const user = bot.users[message.userId];
const user = bot.users[message.userId] || message.user;
const room = bot.rooms[message.roomId];
if (['leaderboard', 'lead', 'leader', 'leaders', 'scoreboard', 'best'].includes(subcommand) && games[command]) {