small fix

This commit is contained in:
Ashley 2024-08-25 13:08:10 +00:00
parent 07caa35eef
commit ba7c40d0a3

View file

@ -72,7 +72,7 @@ function doCommand(client, event, cmd, args) {
if((command.owner && event.sender.userId != process.env.OWNER_ID) || (command.admin && event.sender.powerLevel < 100 && event.sender.userId != process.env.OWNER_ID)) { if((command.owner && event.sender.userId != process.env.OWNER_ID) || (command.admin && event.sender.powerLevel < 100 && event.sender.userId != process.env.OWNER_ID)) {
var addl = `Are you sure this command is for you?\nYour power level is ${event.sender.powerLevel}`; var addl = `Are you sure this command is for you?\nYour power level is ${event.sender.powerLevel}`;
client.reply(event, "nuh uh" + addl, '<img src="mxc://possum.city/b4Vo1BTcq49B7TbFWCqq76HQWQEdNIqq" alt="nuh uh" /><br>' + addl); client.reply(event, addl, '<img src="mxc://possum.city/b4Vo1BTcq49B7TbFWCqq76HQWQEdNIqq" alt="nuh uh" /><br>' + addl);
return true; return true;
} }
@ -102,6 +102,7 @@ client.on(sdk.RoomEvent.Timeline, async function (event, room, toStartOfTimeline
event.sender = client.getRoom(event.sender.roomId).getMember(event.getSender()); event.sender = client.getRoom(event.sender.roomId).getMember(event.getSender());
var content = event.event.content.body; var content = event.event.content.body;
var isCommand = false; var isCommand = false;
for(const prefix of prefixes) { for(const prefix of prefixes) {
if(content.startsWith(prefix)) { if(content.startsWith(prefix)) {
isCommand = true; isCommand = true;
@ -109,6 +110,7 @@ client.on(sdk.RoomEvent.Timeline, async function (event, room, toStartOfTimeline
break; break;
} }
} }
if(!isCommand) { if(!isCommand) {
doModule(client, event); doModule(client, event);
} else { } else {