Jump to content

Small fix

Fixed 2.0.0 2.1.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
GOO_

Posted

Changed Status from Pending to Fixed

Changed Fixed In to Next Version

GOO_

Posted

Thanks for your feedback. I made all of your suggested changes. 

About Us

Codefling is the largest marketplace for plugins, maps, tools, and more, making it easy for customers to discover new content and for creators to monetize their work.

Downloads
2.5m
Total downloads
Customers
11k
Customers served
Files Sold
157.8k
Marketplace sales
Payments
3.4m
Processed total
×
×
  • 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.