Starfinder Playlist
  1. #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)
    Whenever this is registered, the /w and /whisper slash commands no longer work.

    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

  2. #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.

  3. #3
    Quote Originally Posted by Stv View Post
    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.
    And thats exactly what I believe is broken behavior. There is no good reason that /whatever should impact /whisper. Also, its not documented anywhere that there are special reserved starting letters for slash handlers.
    For support with any of my extensions, visit my #mattekure-stuff channel on Rob2e's discord https://discord.gg/rob2e

  4. #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.

  5. #5
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
5E Character Create Playlist

Log in

Log in