Zrips / CMI

115 stars 97 forks source link

DiscordSRV Alerts with CMI commands don't work #4978

Open bobhenl opened 3 years ago

bobhenl commented 3 years ago

Description of issue: Hi, I wanna report that DiscordSRV alerts.yml section don't work with CMI commands. when I use trigger: /unknownworld adsa, then it is shown on Discord image But when I use /cmi broadcast / /broadcast, /helpop, /gamemode.... anything doesn't work. Even when I enabled integration with DIscordSRV in CMI config, but I don't use CMI to format chat, I'm using chatcontrol, but this shouldn't be issue probably... Other commands from other plugins normally work.


CONFIG SECTION (DELETE IF NOT RELEVANT):

- Trigger: /broadcast
  Channel: standard
  Embed:
    Color: "#FFFF00"
    Author:
      ImageUrl: "{embedavatarurl}"
      Name: "Dotaz"
    Description: "${#allArgs}"

- Trigger: /cmi broadcast
  Channel: standard
  Embed:
    Color: "#FFFF00"
    Author:
      ImageUrl: "{embedavatarurl}"
      Name: "Dotaz"
    Description: "${#allArgs}"

Cmi Version (using/cmi version): image

Server Type (Spigot/Paperspigot/etc): Yutopia

Server Version (using /ver): image

Relevant plugins (Delete if this isn't needed): DiscordSRV, ChatControl Red (but this isn't case probably, cause it's command work)

mrfloris commented 3 years ago

Yeah, I was also fighting with /msg, /r, etc. I can't get custom alias commands to trigger either. Nor the default base commands. With or without the config.yml of cmi set to true for using discordsrv.

I guess the next step is to check the cmi api to see what events are being called by cmi for these things and maybe hook into that instead.

mrfloris commented 3 years ago

!! Progress..

Below code: /cmi What i can't get to work are aliaseditor made commands.

  - Trigger: PlayerCommandPreprocessEvent 
    Channel: team
    Conditions:
      - "(#command.split(\"\\s+|$\")[0].equals(\"cmi\"))"
      - "(#command.split(\"\\s+|$\")[1].equals(\"msg\"))"
    Embed:
      Color: "#000001"
      Author:
        ImageUrl: "{embedavatarurl}"
        Name: '**MSG SPY**'
      Description: "Message by `{username}`, Location: `/tppos %player_x% %player_y% %player_z% #{world}` \n ```\n/${#command}```"
Screenshot 2021-02-05 at 12 03 55