TJ-Bot icon indicating copy to clipboard operation
TJ-Bot copied to clipboard

Convert /tag-manage create-with-message & edit-with-message into message-context commands

Open Zabuzard opened this issue 3 years ago • 11 comments

Overview

The two slash commands:

  • /tag-manage create-with-message
  • /tag-manage edit-with-message

would benefit extremely from being transformed into message-context commands instead.

Their old slash-command counterpart can be deleted alltogether.

Duplication

It is up to the implementor to decide how to tackle code duplication best when extracting the commands into new classes. Its possible that some of the existing logic in TagManageCommand has to be moved around for better reusage.

Zabuzard avatar Sep 30 '22 14:09 Zabuzard

y not use modals instead?

Taz03 avatar Oct 02 '22 22:10 Taz03

no idea about modals. how would that look like?

@Tais993 what do u think?

Zabuzard avatar Oct 04 '22 08:10 Zabuzard

https://discord.com/developers/docs/interactions/message-components#text-inputs

first run the command then a modal will pop up write the tag id and content in it and submit and u r done

Taz03 avatar Oct 04 '22 08:10 Taz03

does it show code formatted / preview-wise? how would it be JDA-wise? do we need to create support for that first? in particular for the routing?

Zabuzard avatar Oct 04 '22 08:10 Zabuzard

do we need to create support for that first?

yes

Taz03 avatar Oct 04 '22 08:10 Taz03

does it show code formatted / preview-wise?

i dont think so, wait 5 mins i can check real quick

Taz03 avatar Oct 04 '22 08:10 Taz03

yes it does not 2022-10-04_141616-416x197_scrot

Taz03 avatar Oct 04 '22 08:10 Taz03

yes it does not 2022-10-04_141616-416x197_scrot

it does not? where is the final preview. its all raw and unformatted.

Zabuzard avatar Oct 04 '22 09:10 Zabuzard

Modal does not work with any kind of markdown, so no not an option.

Regarding modal support, once JDA is updated I'll create a small PR which adds support (and i tested or it works)

Tais993 avatar Oct 04 '22 09:10 Tais993

what about we make create-with-message a message context command and keep edit-with-message as slash command

but make edit with message use modals so my idea is instead of edit-with-message we make it edit and it'll take a option id of the tag we want to edit, after that we give a modal which have the previous raw text already and we can just edit that and save

Taz03 avatar Oct 22 '22 16:10 Taz03

just realized we have edit and edit-with-message so we can have a single command edit and it'll have another option clear so if its true the modal will be empty and the user can paste new text

Taz03 avatar Oct 22 '22 16:10 Taz03

closing this as we dont want to make them context commands due to the limit

Zabuzard avatar Nov 08 '22 13:11 Zabuzard