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.
Related
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
I have the following problem, I just created a bot that reads the messages of a specific channel and then I can use them, but I can only invite the bot to my own servers
Is there a way to copy the messages from a server and send them to where I am the administrator?
or to invite a bot to a server without being the administrator?
or make a bot that can read my own messages (since I am inside the discord)
I have been trying all this with discordjs and nodejs but I have not had good results, I can do it perfectly on my own server but when it is an external server I do not know how to do it, if someone knows please help <3
Technically, yes.
To invite a bot, you must have the "Manage Server" permission.
Discord's OAuth2 implementation can allow you to fetch messages from a channel the user has access to.
I'm not going to provide any code, examples, or further information as this seems like you're trying to invade other user's privacy, which will most likely get you banned from Discord.
I wanted to know if it was possible if you could use a bot to add another bot to the current server. Of course the bot would need permissions in the server, but is it possible? Is there a certain code that could be used?
Discord Bots are similar to user accounts in quiet a lot of ways however, bots cannot add other bots to a server.
This is mainly due to security and the fact that Discord wants the server admins to have full control over the server.
I've been working on an instant game for Facebook. All I want is to send a notification that invites the user to play again. I've been checking out documentation for it but it is very unclear on that matter.
I am already using the SDK for instant games and got it running, but I have no idea on how to use the graph API to only send a notification. I don't know in which file I have to put the code for it, nor where to reference it in the index.
you need to add a messenger bot to be able to message users.
check this is the bot docs
[1]: https://developers.facebook.com/docs/games/instant-games/getting-started/bot-setup/
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.