Jump to content

Small fix

Pending 2.0.0

dFxPhoeniX
dFxPhoeniX

Posted (edited)

Hello,

The current trigger check is quite limited:

Quote

if (lowerMessage.EndsWith(lowerPattern) || lowerMessage.Contains(" " + lowerPattern))

It fails in cases like @bot Hello, @bot, Hello, or when the trigger is followed by punctuation.

I suggest replacing it with a regex-based check to make it more flexible:

Quote

if (Regex.IsMatch(lowerMessage, $@"(?<!\w){Regex.Escape(lowerPattern)}(?!\w)")) return true;

This matches the trigger as a whole word, regardless of its position in the message, and avoids false positives.

Also, regarding commands: I’d like to use a command-style prefix such as /askai, but when I set "Command Prefix" to /askai, the command doesn’t work because it isn’t registered as an actual command. It would be great to support custom command prefixes with explicit command registration.

Additionally, it would be nice to have support for multiple languages for plugin messages. For example, messages like:
'Please provide a question after the command.'
could be configurable or translatable from language folder.

Edited by dFxPhoeniX
2.2m

Downloads

Total number of downloads.

10.2k

Customers

Total customers served.

147.4k

Files Sold

Total number of files sold.

3.1m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.