-
May 22nd, 2022, 00:33 #1
Comm.registerSlashHandler disabling chat whisper
In one of my extensions, I register a slash handler using the following command.
Code:Comm.registerSlashHandler("whospeaks", handleWhoSpeaks)
After doing some testing, it appears that registering any slash command that begins with a "w" will cause whisper to stop working. It just fails silently.
I have tried registering "wh", "wt", "wZ" and all cause whisper to fail.For support with any of my extensions, visit my #mattekure-stuff channel on Rob2e's discord https://discord.gg/rob2e
-
May 22nd, 2022, 10:37 #2
Iirc, that is the operation for any slash command that can be shortened i.e.
/w and /whisper do the same thing,
/r and /reply do the same thing
But if you register another slash command that begins with a 'W' or an 'R' then the single letter slash command will stop working.
Cheers, Steve.
-
May 22nd, 2022, 13:35 #3For support with any of my extensions, visit my #mattekure-stuff channel on Rob2e's discord https://discord.gg/rob2e
-
May 22nd, 2022, 19:29 #4
I asked a related question in this post
https://www.fantasygrounds.com/forum...l=1#post490706
and Moon Wizard said in post #2 that the shortcut versions only work if the shortcut is unique.
I agree this is far from ideal if you wish to use a new handler that starts with the same letter as an already existing handler.
Cheers, Steve.
-
May 23rd, 2022, 07:11 #5
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,561
There is a different function you will want to use for registering slash handlers for CoreRPG layering. In order to provide the additional help text that CoreRPG supports, you will need to register like this:
ChatManager.registerSlashCommand("w", ChatManager.processWhisper, "[character] [message]");
If you use Comm.registerSlashHandler, it will match before falling through to the CoreRPG layer. Thus, the issue you are seeing. (i.e. your handler is registered in the client; so overrides anything with same letters in CoreRPG layer).
There are several examples in the ChatManager script in CoreRPG.
Regards,
JPG
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks