slashtags icon indicating copy to clipboard operation
slashtags copied to clipboard

Add support for new lines via "\n"

Open net-tech opened this issue 2 years ago • 7 comments

Because of Discord limitations, new line inputs aren't supported for slash commands, and the bot does not have a way of supporting them.

A nice workaround would be where \n in tags is automatically replaced with a new line. This would require a simple function to replace \n with a newline before storing the tag content in the database.

Optionally, if \n is provided, that could be parsed as literally \n, though I doubt anyone puts \n in their tags to explain something.

Example code:

const parsedNewlines = r.replace(/\n/g,' ')

net-tech avatar Dec 03 '22 18:12 net-tech

I realize this issue is from last year but I just found this bot and it is exactly what I am looking for... Only that without new line support of some type, I cannot use it. :(

Please add it.

FravBox avatar Aug 24 '23 05:08 FravBox

As a workaround, you can create/edit the tag on mobile, where you can use newlines in slash commands.

This suggestion is a hacky workaround and it might interfere with that functionality, but maybe I'll see if it's doable

As a proper fix I want to use modals instead, but unfortunately those cannot provide a great UX currently since they don't support checkboxes (for the ephemeral toggle). Maybe I'll add a separate command for modal editing so it doesn't interfere with the current flow

advaith1 avatar Sep 09 '23 04:09 advaith1

@advaith1 What if you had your existing command have the ephemeral, and then bring up a modal where you ask for text input? You could tell the user they will be shown a modal after they run the command in the description.

net-tech avatar Sep 09 '23 10:09 net-tech

Hi, found this bot but noticed this hasn't been implemented yet... any updates on this?

Wyvest avatar Jul 29 '24 16:07 Wyvest

As a workaround, you can create/edit the tag on mobile, where you can use newlines in slash commands.

This suggestion is a hacky workaround and it might interfere with that functionality, but maybe I'll see if it's doable

As a proper fix I want to use modals instead, but unfortunately those cannot provide a great UX currently since they don't support checkboxes (for the ephemeral toggle). Maybe I'll add a separate command for modal editing so it doesn't interfere with the current flow

Why use a checkbox? Why not have a dropdown with 2 options: "ephemeral" or "regular message" ?

FravBox avatar Jul 29 '24 20:07 FravBox

modals don't support select menus either, only text inputs

advaith1 avatar Jul 29 '24 22:07 advaith1

@advaith1 What if you had your existing command have the ephemeral, and then bring up a modal where you ask for text input? You could tell the user they will be shown a modal after they run the command in the description.

This would work

net-tech avatar Jul 29 '24 22:07 net-tech