Verification URL for Discord JS - javascript

Would it be possible to create a one-click URL verification system in Discord JS. Essentially, when you signup for my service you get an email with a verification URL that when clicked adds you to the discord server, gives you the appropriate role, and adds you to my Mongoose database. I've seen this kind of system done for regular applications, but never through discord.

You can make use of the discord OAUTH2 system to gain access to add the user to guilds automatically. You can create a 2 stepped system first it would verify the user in the local database and then redirect them to the generated OAUTH2 URL
https://discord.com/developers/docs/topics/oauth2

Related

Can we update the user status by bot token in slack app?

I have a react app with a lot of users, and I want the user's status to change in Slack when the user logs in to my app. Is it possible with a bot token?
and also how to get email of user who install my slack application
I have a react app with a lot of users, and I want the user's status
to change in Slack when the user logs in to my app. Is it possible
with a bot token?
You are able to update a user's status, however, you will not be able to do this with a bot token. Since you are taking actions on the user's behalf, you will need to use a user token. See more https://api.slack.com/methods/users.profile.set
and also how to get email of user who install my slack application
You are not able to get the emails of user's on install, however, you are able to achieve this through other Slack events. For example when the user access the Slack's app Home.
First subscribe to the app_home_opened event
When the event happens, get the user ID of the slack user
Utilize the users.info method to gather info on the user. See more: https://api.slack.com/methods/users.info
For this to work, ensure you have the users:read:email scope for your bot. See more: https://api.slack.com/scopes/users:read.email

Change bot avatar only in specific guilds

I'm trying to make a multi-guild bot and I'm struggling with making a command that changes the bot avatar only for the guild where the command was executed!
I tried to make a DISCORD API call to change the bot user avatar but I ended by changing the avatar for all guilds.
You simply can't do that. Bots don't have access to some user functionalities like blocking someone, joining a server without a moderator's will and, in this case, change it's avatar/username depending on a server. An alternative is to create a webhook. You can change (with the necessary permissions) it's avatar and username at free will and it can send messages, embeds, files etc.. there's a full guide on discord.js webhooks if you want.

Getting discord webhook from site

Is there a way to get a Discord webhook from a site? I know of a phishing site that prompts you for your name and password, which it then sends to a Discord server. Last time they were using JavaScript for the webhook so it was easy to find it and delete. Now they are using PHP. Is it possible to find the webhook?

Discord JS - How to get links to connected accounts of a user

Is there a way in which I can retrieve the links to all the social medias and other accounts a person has connected to their discord account?
I searched the docs to no avail and tried looking in the user object but I found nothing. I assume there must be some way in which I can retrieve this information?
As far as I know it's not possible with just the code of the bot. To get the connections, you must bring the user to authorize your application Oauth. Its like adding a bot to a server, but instead of doing this the user authenticates the bot to get some information about the user.

Telegram bot api, send message via #username

My telegram bot can communicate with users and I want to send results of their chat to admins telegram account.
I'm using node telegram bot api as my bot backend. How is it possible to send message to specific #username via telegram?
Multiple strategies can be done to archieve that.
Simplest strategy from the top of my head is:
Initiate a conversation to the bot, send some password that identifies you as admin (i.e. using a custom start parameter https://telegram.me/ExampleComBot?start=vCH1vGWJxfSeofSAs0K5PA ) and store this chat_id somewhere as you know it is a admin chat_id. Then, everytime a user chats with the bot, use the bot to send the same message to admin chat_id.

Categories