mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-05-02 20:19:55 +03:00
Allow mentions to act as command prefixes + bug fixes
This commit is contained in:
parent
2493e317d0
commit
b2b54b7fd4
3 changed files with 15 additions and 20 deletions
|
@ -1,6 +1,5 @@
|
|||
using Boyfriend.Commands;
|
||||
using Discord;
|
||||
using Discord.Commands;
|
||||
using Discord.Rest;
|
||||
using Discord.WebSocket;
|
||||
|
||||
|
@ -82,9 +81,8 @@ public class EventHandler {
|
|||
prevFailsafe = prevsArray[2].Content;
|
||||
}
|
||||
|
||||
if (!(message.HasStringPrefix(guildConfig["Prefix"], ref argPos) ||
|
||||
message.HasMentionPrefix(Boyfriend.Client.CurrentUser, ref argPos)) || user == guild.CurrentUser ||
|
||||
(user.IsBot && (message.Content.Contains(prev) || message.Content.Contains(prevFailsafe))))
|
||||
if (user == guild.CurrentUser || (user.IsBot &&
|
||||
(message.Content.Contains(prev) || message.Content.Contains(prevFailsafe))))
|
||||
return;
|
||||
|
||||
await CommandHandler.HandleCommand(message);
|
||||
|
@ -180,4 +178,4 @@ public class EventHandler {
|
|||
await channel.SendMessageAsync(string.Format(Messages.EventCompleted, Utils.Wrap(scheduledEvent.Name),
|
||||
Utils.Wrap(scheduledEvent.StartTime.Subtract(DateTimeOffset.Now).Negate().ToString())));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue