Do we have a way to differentiate between a dismissed ephemeral message and a non-dismissed one In discord?
do we have a special property in the message object ? some API to fetch this info ?
There is no possible way to get ephemeral messages.
I ended up by removing all the content of last message so the user won't give a big attention and simply will dismiss it by clicking or ignore it.
Related
I have some interaction that returns an ephemeral message with components. From those components, I want to be able to reply with a non ephemeral message (replacing the ephemeral message). I know it used to be possible, because many times while I was coding my application, I forgot to set the options flag in some replies, and that made the message turns to visible for all. But now, when I try to reply with a message without specifying the flag, it doesn't change and still display the reply in a ephemeral message.
I have heard that Discord added a new parameter about ephemerality in the interaction format to have a proper support. I think my issue is linked to that, and even tho flags options still work, I must use that parameter for my needs. However, the documentation is not updated yet.
Is it still possible to do that, and is there somewhere I can find information about the said parameter?
You cannot change a reply from ephemeral to public. A suggestion I have would be to simply follow up with a new message. If you are trying to make it public to ephemeral, you can delete the original reply. You can't however do it the other way around, since the user has to manually delete it
interaction.reply({
content: "ephemeral message",
ephemeral: true
}
// you can use any event, but I am using setTimeout
setTimeout(() => {
// interaction.deleteReply() --- only use if it starts out public
interaction.followUp({
content: "public message",
ephemeral: false
})
}, 3000)
I need help reacting to the most recent message. This can be in a specified channel or just in the server. The main thing I need help with is getting the message id or info about the most recent message, the reacting part I can do.
Please let me know if there is a solution, as everything I have looked up hasnt produced any results.
Thanks!
There are quite a few methods to get the last message in a channel. Assuming you already have a specific channel in which you want to react. Use
last_message = channel.last_message #channel must be a discord.Channel
The docs specify that this could sometimes get the wrong message, hence we use
messages = await channel.history(limit=1).flatten()[0]
References:
last_message
history
Tip:
Try searching for the relevant class in the docs instead of googling
I want to send an email based on status the of a sub-task executed 2 steps before.
In the current action Send an email, I'm using the runAfter event to state the name of the action that failed:
"runAfter": {"HTTP_2": ["Failed"]}
However system does not allow this and I get the following error message.
The action HTTP_2 must belong to the same level as action as Send-an-email.
Any ideas how to get around this?
I believe this error occurs when you are trying to runAfter a step in a different scope. Is the "send_email" step within a condition, scope, or loop? If so the entire condition/scope/loop would need the runAfter (or you would need to have send_email outside of the scope). Other than that it should work. Let me know.
I found a solution which was simple in the end, I just had to switch to 'advanced mode' when entering the condition and enter
#not(equals(outputs('HTTP_2')['statusCode'], 200))
You can thus refer to any step in the workflow.
See attached what the full solution looked like to get a better idea:
enter image description here
What I want to achieve:
I am coding a Java program that uses IMAP to connect to some gmail accounts every 5 minutes and extract information from some messages.
I want to check all the messages (incoming and outgoing) and take only the ones I have not processed. By "processed" I do not mean only "read" or "seen" messages. My application does not care whether or not another user has accessed that account and read a message. My application needs to keep track of which was the last message it processed and, the next time it goes through the messages, start with the first non-processed message.
I do not want to change anything in the messages. I do not want to mark them as seen or read.
What I have implemented:
Establish IMAP connection.
Open and access all messages in "[Gmail]/All Mail" folder.
What I have tried:
I have been reading about UID and message number, but I am not sure if any of them could help me achieve what I want. Maybe UID could, but: how do I retrieve it with JavaMail?
I found Folder.getMessages(int start, int end), but I think it refers to the index of the message in a folder, which I believe can easily change.
Can anyone provide some guidance at what is the best approach to take here?
Thanks!
IMAP UIDs are relative to the folder containing the message. I don't know how Gmail handles UIDs for messages in the "[Gmail]/All Mail" folder, but if it does the right thing you could use the UIDFolder interface to get the UIDs. And as described, once you've processed a certain UID, all the new messages will have larger UIDs, which can make processing more efficient.
The alternative is to use Message-IDs, which has a different set of problems...
thanks for taking time looking at my question.
Ok so I'm working on this iPhone app. I'm responsible for the server side code. Client side is asking for a solution to delete private messages from the app. I have created a HTTP DELETE for them that deletes a specific message. But this request deletes the message from the database and that makes the message disappear for both users and not only the one that have choosen to delete it.
I've been thinking but I can't seem to find the best solution for this. What I need is a solution to only delete the message for the current user.
Should I add some columns in the database that tells which user the private message should be shown for? And when a user deletes the message from the app it only stops showing on that users phone. Or is there a better solution for this?
I need help with some brainstorming. I hope it is an OK question.
Thanks!
A physical delete should probably be avoided. The first couple of reasons I can think of:
how can you do proper testing/audit if the information you're looking for is gone?
legal issues: do you need some levels of data retention?
You can implement some form of logical delete, for example with an extra relation such as UserMessage( UserID, MessageID, MessageStatus ), where MessageStatus could be "unread", "read", "deleted", "important", "spam", etc. (you can map the status to an arbitrary integer if you prefer). When a user deletes a message, you simply change its status in the UserMessage relation, and from the UI side you hide messages which are marked as "deleted".