Ajneb97 / ConditionalEvents

MIT License
22 stars 12 forks source link

DiscordSRV cannot send custom commands #31

Closed Tarquitet closed 10 months ago

Tarquitet commented 10 months ago

A simple and quick example to make the situation known. It is assumed that when a command is registered, it can be used without any problems on the server.

What happens is that discord (using the DiscordSRV plugin) does not allow you to send those custom commands from the channel where the discord server console is being used to the game.

It can be used from the original server console, but not from the discord console.

Some captures: SharedScreenshot /pl command from Discord -> Game.

SharedScreenshot_1 Other command in the server console.

SharedScreenshot_2 Custom command in server console.

SharedScreenshot_3 Custom command in Discord.

Psd: This is the console command event that I use.

agregar_whitelist_command_consola: # AGREGA A LOS JUGADORES A LA LISTA BLANCA DESDE LA CONSOLA
    type: console_command
    conditions:
    - '%main_command% == add'
    - '%args_length% < 1 execute error_add_whitelist{%error_message%=&cDebes usar
      &7/add <jugador>}'
    - '%otherplayer_hasperm_{arg_1}_perm_conditionalevents.whitelist.added% != no
      execute ya_esta_en_lista'
    actions:
      default:
      - 'cancel_event: true'
      - 'console_command: lp user %arg_1% permission set conditionalevents.whitelist.added'
      - 'console_message: &e%arg_1% &cha sido agregado a la lista blanca.'
      ya_esta_en_lista:
      - 'cancel_event: true'
      - 'console_message: &e%arg_1% &cya está en la lista blanca.'
      error_add_whitelist:
      - 'cancel_event: true'
      - 'console_message: &c&m                    &r &c&l¡ERROR! &c&m                    '
      - 'console_message:  '
      - 'console_message: %error_message%'
      - 'console_message:  '
      - 'console_message: &c&m                                                    '

Commands are registred.

  register_commands:
  - add
  - remove # other case
Ajneb97 commented 10 months ago

The register commands option in ConditionalEvents is just a visual feature to show the command on the tab completion on chat. You could try creating and registering the command with MyCommands, but I don't know if it really creates the command and can be used in the way you want to.

Tarquitet commented 8 months ago

Possibly it could be added that the logged command is not just a visual effect but also logs like Mycommand does?