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.
#Flag certain bot messages
1 messages · Page 1 of 1 (latest)
Hey! Once your issue is solved, press the button below to close this thread!
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?
maybe could hide some kind of invisible emoji in the content?
and then check for that
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
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
no it has to end with these characters, i.e:
if message.content.endswith("** **"):
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
yep you're right just tested it
I'll add a space in between if there is already a ** at the end
You can also use a zero width character or some other invisible one
to not mess up formatting
damn thanks, that's so much better actually! Didn't know about this character, very useful