japandotorg / Seina-Cogs

My public cogs for red.
https://seina-cogs.readthedocs.io/en/latest/
Other
13 stars 18 forks source link

[TSE] Multiple Issues with `TagScript Block` & `TagScriptEngine` #49

Open cool-aid-man opened 4 months ago

cool-aid-man commented 4 months ago

Heya lemon, Opening up an issue if that makes you easier to work on & keep track of -

  1. Broken blocks - {shortcircuit} or {break}

    Traceback Here - from your channel in cog-support server.

  2. Making {override} block to override more commands - - Override doesn't work in quite a few commands - from red's core, mod to other 3rd party cogs - such as in roletools It cannot override role add / role remove currently, commands like slowmode (from Mod cog), which it should be able to override, etc.

  3. In TSE, the issue with simultaneous usage of command blocks, leads to miss execution of a few. - In TSE currently ALL 3 command blocks execute/run at the exact same time which is problematic, so adding a delay (for a few milliseconds) or making it so it executes one after another might solve the issue plus it's the right way to do.

4.1 Currently " processing reasons" In TSE, embed block {embed(description)} - The description is capped at 2k characters, even tho embed description can easily go up to 4096 characters. This cap should be removed. āš ļø Note that - At the moment with all the "manual attributions" you still can't create the embed having more than 4k characters.

E.g. Try with šŸ‘‡ (It'll limit you at 4k characters - using ALL the attribution) {embed(title):title} {embed(description):description} {embed(field):name|value}

  • The API's limit is 6k characters in total including ALL the parameters. As follows:
    Field Limit
    title 256 characters
    description 4096 characters
    fields Up to 25 field objects
    field.name 256 characters
    field.value 1024 characters
    footer.text 2048 characters
    author.name 256 characters

  • (Additionally, the combined sum of characters in all title, description, field.name, field.value, footer.text, and author.name fields across all embeds attached to a message must not exceed 6000 characters. Violating any of these constraints will result in a Bad Request response.)

4.2 AND currently in TSE, embed JSON - You can't create an embed having more than 2k characters (even tho the limit is 6k characters in total). This limit should also be removed.

  • E.g. Try creating a tag with {embed({"title": "title", "description": "description"})} (include all the other parameters title, descriptions, fields, author, footer ), You will see it is limited to 2k characters.

ā€‹ ā€‹

  1. This one is not really an issue: But in {target} block - https://github.com/japandotorg/Seina-Cogs/blob/598c23794fc6c2a09dc569641e2bbebe07dad166/tags/mixins/processor.py#L138 Can this use/accept ID (from the user_message - by checking if the message has user ID ) instead of taking the ID from user_mention !! - Because target block won't work if you pass just the ID (of a targeted user), and IDs are the first thing that you copy then you add <@> to make it mention, so being a user you're by default passing IDs first ā€‹ ā€‹
  2. In Tag global https://github.com/japandotorg/Seina-Cogs/blob/3ea973eea1c91df9554c3234e1bbb22f345b3d19/tags/mixins/commands.py#L595
    • tag global add should behave just like adding a guild tag with tag add. Currently with tag global add it does not prompt you to override the tag with new data (so you'll have to delete > add it again). image
      • Same issue with tag global ++ (tag global pastebin); it should behave just like adding guild tag ++

Proposed Updates on TSE

(Changing the delimiter to accept Multiple characters would solve the issue, but it won't be a huge breaking change per se. - Fewer tags will be broken if not none, this way)

I think, this is all the problems we have with TSE at the moment, I hope you can get back to this as soon as possible as it's been pending for many months!