#Flag certain bot messages

1 messages · Page 1 of 1 (latest)

marsh oasis
#

Ok I'll try to quickly explain the feature I want to implement. Basically, I need to make some messages of my bot editable by staff of the server (for example via a Message Command). But not all bot messages should be editable! So my question is, is there a way to flag some messages of the bot so that it know if this message can be edited or not by a user?
Right now the only way I found is probably to use a db and write all IDs of messages that can be edited in it, so I can easily check if the message is editable or not.

quasi sunBOT
#

Hey! Once your issue is solved, press the button below to close this thread!

marsh oasis
#

Basically if something of a message could be used to encode a hidden flag in it. I know buttons do that well because you can set them with custom IDs that have, let's say, a user ID or stuff like that. But plain messages?

lucid vortex
#

maybe could hide some kind of invisible emoji in the content?

#

and then check for that

unique star
#

nah

#

just store messages in db

marsh oasis
#

Ok I think I found a hacky way lol

#

basically when the message is first sent, I send the message + ** ** at the end

#

like:
Hi!** **

#

for the client it looks like just a space at the end of the message but now I can easily check if ** ** is at the end of the message

lucid vortex
#

cool way to do it lol

#

but maybe could cause issues if other markdown is present in the message?

#

or just ** earlier in the message but idk how often that would happen

marsh oasis
#

no it has to end with these characters, i.e:
if message.content.endswith("** **"):

lucid vortex
#

no i mean if u have that at the end but ** is present earlier on in the message like **hello ** ** could turn into **hello ** **

#

its pretty unlikely though

marsh oasis
#

yep you're right just tested it

#

I'll add a space in between if there is already a ** at the end

exotic lintel
#

to not mess up formatting

marsh oasis
#

hm let me look at that

#

marsh oasis