mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 01:21:20 -04:00
everyone can status!
This commit is contained in:
@@ -265,13 +265,15 @@ async function handleCommand(message) {
|
|||||||
if (message.author.bot) return;
|
if (message.author.bot) return;
|
||||||
const content = (message.content || '').trim();
|
const content = (message.content || '').trim();
|
||||||
if (!content.toLowerCase().startsWith('rs')) return;
|
if (!content.toLowerCase().startsWith('rs')) return;
|
||||||
if (!isAdminUser(message.author.id)) {
|
|
||||||
return; // ignore non-admins
|
|
||||||
}
|
|
||||||
|
|
||||||
const tokens = content.split(/\s+/);
|
const tokens = content.split(/\s+/);
|
||||||
tokens.shift(); // remove prefix
|
tokens.shift(); // remove prefix
|
||||||
const action = (tokens.shift() || '').toLowerCase();
|
const action = (tokens.shift() || '').toLowerCase();
|
||||||
|
const isAdmin = isAdminUser(message.author.id);
|
||||||
|
|
||||||
|
if (!isAdmin && action !== '' && action !== 'status' && action !== 'help') {
|
||||||
|
return; // ignore non-admins for privileged commands
|
||||||
|
}
|
||||||
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case '':
|
case '':
|
||||||
|
|||||||
Reference in New Issue
Block a user