TL;DR
Is there a way to send an ephemeral message to a user without using an Interaction ?
Usage
Interactions are a great tool to interact with user. Replying with ephemeral message is great too, to avoid notifying unrelated users.
Initiating an Interaction wouldn't be limited to SlashCommands, Users and MessageCommand but with reactions, specific content in messages, member nickname updates etc...
The iteraction would then pursue with ButtonsCommand in an ephemeral message.
I know I can use the old way (directly dm the user), but it would be more convenient to have an ephemeral message directly in the same channel.
Workaround
The only way I have found so far is having the user typing a command (or making any interaction that will act as an anchor point). And the later, when an ephemeral message is needed, make a follow up message from that interaction.
The downside of this solution is the user has to make an interaction in all channels that would require spontaneous ephemeral message. And also, users have to do an interaction in the first place, which isn't very convenient when you want to deal with new users.
The Ephemeral Messages FAQ and Developer Documentation on Interaction Responses show that only interaction responses currently support ephemeral messages.
There will not be any support for uninvoked ephemeral messages, according to Mason, a Discord engineer (screenshot), as it would open quite a lot of abuse possibilities.
As AEnterprise said in the Discord Developers server: "imagine bots being able to spam advertisements only visible to specific members, that are not stored [on Discord's servers] so very little to no proof for Trust & Safety to even look up".
Related
I want an app/bot that reads the last message that were sent to a specific channel on a server that I participate and depending on the text I want to send a message to that same channel. The thing is, I want to do it in my name, not using a bot id. I know that you can create a bot using your own name and avatar but what I really want is to send a message using my own account. Is that possible? Could not find anything like that in the docs, maybe a missed something?
I do not think you are even allowed to do this so I doubt the discord API would have support for this
Discord Guidelines
"Do not use self-bots or user-bots. Each account must be associated with a human, not a bot. Self-bots put strain on Discord’s infrastructure and our ability to run our services. For more information, you can read our Developer Policies"
However, if you really wanted to do this you could use a macro at the risk of getting your account banned by discord if they found out. You could create a macro in python using the pyautogui module.
Excuse me if I missed something and this is a duplicate, other QA's still left me with some questions.
I wanted to see if it was possible for my bot to access user connections (Steam acc, Reddit, etc.) so that the user can use a command to enable notifications in a specific channel, so that it would promote when they publish a video.
I've found similar bots, but they all required manual entering and they were admin-only.
I've found that it is NOT possible to directly access them (and rightfully so):
Unfortunately this is not possible when using a "real" bot account, however it is possible if you're using a user bot account.
I'd suggest a workaround of using OAuth2. You could have users authenticate your bot with OAuth2, and then fetch their connections this way. Some more information at https://discordapp.com/developers/docs/topics/oauth2
(Link: https://stackoverflow.com/a/44265167/16255372)
But that last statement about OAuth really got me wondering.
If it is required for each user to authenticate via a link, that is an acceptable compromise for me.
On the discord developers website, I've found a connections scope which would allow the bot to access the connections of the user that authenticated via the link.
I also found a url for getting the user's connections here
Get User Connections
GET /users/#me/connections
Returns a list of connection objects. Requires the connections OAuth2 scope.
But on other sources, I've seen that the scope is inaccessible to bots.
Furthermore, I don't see connections accessible in discord.py, which is what I use.
So my question is + TL;DR:
Is it possible to access the user's connections, even if they each have to click on an oauth link
(connections scope)
Would this be possible using discord.py?
(potentially using discord.ClientUser?)
Thank you for reading, I am also a new contributor. If you feel that I missed something or could elaborate or explain things better, please let me know how I could improve my question.
Is it possible to access the user's connections, even if they each have to click on an oauth link (connections scope)
YES (only possible using OAuth).
Would this be possible using discord.py? (potentially using discord.ClientUser?)
Unfortunately, no. Discord.PY does not support OAuth. You would have to do it yourself by creating a Web Application etc.
I'm designing a custom team tab using React that calls third party API, I need after executing the API successfully, user gets notified . What is the best way to achieve this? I used Bot in my project, but not sure how can I call it from my custom tab class. I'm aware of the existence of proactive messaging, is it the only way to do it? If it is, a pointer on how to implement it to a custom tab would be appreciated.
If you're wanting to message the user 1-1 (like in the personal app), then proactive messaging is definitely what you need (inside a Team, there are other options), and considering you have the bot already in place that's perfect. The only thing you might be missing are the details required to send the actual proactive message (the best time to get them is when the bot is first installed by the user). In particular, you need ConversationId and ServiceUrl.
With regards the concept of Proactive Messaging, basically once the bot is installed, and you have the required values, you can -send- the message from any backend code at all. That can include, for example, custom tab's backend api. You need to identify the user, which you can do using the Teams Context (it's not the safest way but it's the easiest), and then look up the values in your own backend store (e.g. database or whatever) to get the ConversationId and ServiceUrl, then just message the user in your backend.
I'm building a messaging system for GCP-hosted platform and plan to use Gmail as a backing system. Users can write their messages through our system which will invoke Gmail API to send emails to other recipients. When someone responds, Gmail API sends a push notification and our system in turn notifies a used.
As I expect high spikes of user activity, the limitation of 1 notification per second (https://developers.google.com/gmail/api/guides/push):
Each Gmail user being watched has a maximum notification rate of 1 event/sec. Any user notifications above that rate will be dropped.
doesn't seem to work for me. But to be sure I want to understand what does it exactly mean.
In particular:
what will happen if my mailbox receive 100 emails in a second? Will Gmail generate a single notification which will include all 100 messages? Or there will be several notifications generated which will eventually notify me about all messages? Or due to high messages rate and the above-mentioned limit of 1 notification per second I will receive a single notification for the first message and the rest 99 will not be pushed to my backend?
What the documentation tells you is that, if 100 notifications appear on the same user on gmail at the same time, the first notification would come thru, then the other 99 would be dropped.
However, there is a way to recover changes by using history events, this is referred to as sync and there are multiple ways to do this. I suggest you read up on the Partial Synchronization guide.
The documentation also offers some advice on how you should architect your code to deal with this, specially in the Reliability section of the documentation.
Someone invited me to be a developer on his app. I did not get the email invite?
I have had others invite me and it works (and works well!)
We got around the problem by having an invite sent to another account. That works for now, but I really need the invite to be sent to the correct account.
Gary
The question is borderline off-topic in that it's not usually a programming question, but it comes up so often, from programmers and the customers we support, that I wanted to put an answer here in the hopes that it would be helpful.
I see that it was in your spam folder, which is one of the more common causes of "lost" emails.
In short, when an email is sent from one server, it goes through several other servers and routers on the way to the final user's PC.
Any one of the following conditions could cause a sent email to not reach a recipient:
Blocked Outbound Mail - The sender's company/business/ISP has email scanning software that scans outbound email, and blocks suspicious outbound emails.
Our workplace has this to limit sensitive data being sent out accidentally, to block outbound infected emails sent from infected PCs.
Relay Server Permissions/Configuration - Your code is sending through a relay server that has rules blocking unauthorized use of email relay functionality.
In most shops with good security consciousness, email servers are configured to disallow email relay except for known IP addresses and/or known, explicitly authorized users.
External party blocks the email - The sender's company has been blacklisted.
Blocked Inbound Mail - The receivers company has email scanning software that scans incoming email (similar to #1) to block malicious/non-work related/bad emails from reaching the recipient's inbox.
Receiver's Spam Filtering - The receiver's email inbox has spam mail filtering, which may automatically move the email to a spam folder, delete them, or other action depending on how you have it configured.
Receiver's Inbound Mail Rules - Similar to the above. The recipient may have rules defined that block, delete, or move emails.
Outlook allows this, as do other email clients. Emails can match the patterns set for existing rules and result in false positives that trigger the rule execution.
Human error - the sender sent the email to the wrong email address.
Human error - the recipient accidentally deleted the email and just didn't see it. (You'd be surprised how often I've seen this.)
Bad programming - there was an error sending the email, but the exception handling ignores the error, so nobody ever knows any better.
Only #9 is actually a programming issue, and it's also (in my experience) the least common. Odds are that the problem has nothing to do with code that you'd be writing.
I'm sure there are more, but these are the ones I've seen the most frequently. I'll add as I think of others.