Alcinzal
Alcinzal
DIAdiscord.js - Imagine an app
Created by Alcinzal on 7/16/2024 in #djs-questions
Send a dm to user after bot/app has been added/authorized? (user install)
I see. Thank you, I have gotten it working now. Using response_type=token still doesn't seem to work, however response_type=code works just fine. And that is what is preferable anyways. So thank you for the help.
50 replies
DIAdiscord.js - Imagine an app
Created by Alcinzal on 7/16/2024 in #djs-questions
Send a dm to user after bot/app has been added/authorized? (user install)
But you got response_type=code working fine right? Because I initially thought that there was a bug with it, I thought when you clicked authorize it should just automatically authorize the bot to your account, but you first need to take that code and POST it to the discord api, and that makes it actually authorized and gives you the token. And then further use this token to get the information about the user. This token has worked for me so far, has it worked for you too?
50 replies
DIAdiscord.js - Imagine an app
Created by Alcinzal on 7/16/2024 in #djs-questions
Send a dm to user after bot/app has been added/authorized? (user install)
Alright thank you I will give it a shot there.
50 replies
DIAdiscord.js - Imagine an app
Created by Alcinzal on 7/16/2024 in #djs-questions
Send a dm to user after bot/app has been added/authorized? (user install)
I think I also got it working once just now, but trying to recreate it gives me no luck.
50 replies
DIAdiscord.js - Imagine an app
Created by Alcinzal on 7/16/2024 in #djs-questions
Send a dm to user after bot/app has been added/authorized? (user install)
Because if I do that, the app just redirects, and never gets authorized, could you also test that?
50 replies
DIAdiscord.js - Imagine an app
Created by Alcinzal on 7/16/2024 in #djs-questions
Send a dm to user after bot/app has been added/authorized? (user install)
When you say full code grant, you mean the response_type=token part? To be response_type=code?
50 replies
DIAdiscord.js - Imagine an app
Created by Alcinzal on 7/16/2024 in #djs-questions
Send a dm to user after bot/app has been added/authorized? (user install)
Really weird, and if you go to authorized apps you see the app there with the correct permissions?
50 replies
DIAdiscord.js - Imagine an app
Created by Alcinzal on 7/16/2024 in #djs-questions
Send a dm to user after bot/app has been added/authorized? (user install)
https://discord.com/oauth2/authorize?client_id=xxxx&response_type=token&redirect_uri=https%3A%2F%2Fexample.com&integration_type=1&scope=applications.commands+identify
https://discord.com/oauth2/authorize?client_id=xxxx&response_type=token&redirect_uri=https%3A%2F%2Fexample.com&integration_type=1&scope=applications.commands+identify
Is it like this?
50 replies
DIAdiscord.js - Imagine an app
Created by Alcinzal on 7/16/2024 in #djs-questions
Send a dm to user after bot/app has been added/authorized? (user install)
How does your link look like?
50 replies
DIAdiscord.js - Imagine an app
Created by Alcinzal on 7/16/2024 in #djs-questions
Send a dm to user after bot/app has been added/authorized? (user install)
I know, you can do this with it: curl -H "Authorization: Bearer <token>" https://discord.com/api/users/@me And you get a json response with all information you need. It works only if applications.commands is not a part of the scope.
50 replies
DIAdiscord.js - Imagine an app
Created by Alcinzal on 7/16/2024 in #djs-questions
Send a dm to user after bot/app has been added/authorized? (user install)
Yes I know, and using identify alone as the scope, does work. You get the bearer token, and you can send a request to discords api server, and you get the information you need. However combining identify with applications.commands, make the token not work anymore. It just returns 401.
50 replies
DIAdiscord.js - Imagine an app
Created by Alcinzal on 7/16/2024 in #djs-questions
Send a dm to user after bot/app has been added/authorized? (user install)
If response_type is set to token, it will redirect, and you will get the bearer token in the link after the hashtag. However this token does not work when trying to receive data using discords api.
50 replies
DIAdiscord.js - Imagine an app
Created by Alcinzal on 7/16/2024 in #djs-questions
Send a dm to user after bot/app has been added/authorized? (user install)
Exactly, but the problem is that, combining applications.commands with identity does not work. The token does not work, and if response_type is set to code, it does not get authorized. Setting scope to just identity does make the token work, but I need applications.commands scope for the bot to be able to DM the user.
50 replies
DIAdiscord.js - Imagine an app
Created by Alcinzal on 7/16/2024 in #djs-questions
Send a dm to user after bot/app has been added/authorized? (user install)
I have tested it, and it does work. If the bot has the scope set to applications.commands, it will be given the permissions to "Create commands" and "Send you direct messages (without sharing servers)". And if the user authorizes this, the bot, if it has the users ID, will be able to send the user DMs, without the user sending anything first.
50 replies
DIAdiscord.js - Imagine an app
Created by Alcinzal on 7/16/2024 in #djs-questions
Send a dm to user after bot/app has been added/authorized? (user install)
If the bot has the user id, it has the ability to send the user DMs without the user first sending something. The only thing I really need is the users ID upon adding it, but I suppose that is not possible yet. Sad
50 replies
DIAdiscord.js - Imagine an app
Created by Alcinzal on 7/16/2024 in #djs-questions
Send a dm to user after bot/app has been added/authorized? (user install)
Yes, that is what I wish to achieve.
50 replies
DIAdiscord.js - Imagine an app
Created by Alcinzal on 7/16/2024 in #djs-questions
Send a dm to user after bot/app has been added/authorized? (user install)
The reason I want to add both applications.commands and identify to the scope, is because when you authorize an app as user install here on discord, it does not appear in the direct messages tab. You have to first interact with it. I would like the bot to interact with the user when it authorizes the app, giving the user an easier time, instead of making the user try to find the bot by going to discord.com/users/<bots id>
50 replies
DIAdiscord.js - Imagine an app
Created by Alcinzal on 7/16/2024 in #djs-questions
Send a dm to user after bot/app has been added/authorized? (user install)
By adding applications.commands to the scope it adds 2 items to the list of what the app will be allowed to do "Send you direct messages (without having to share servers)" and "Create commands".
50 replies
DIAdiscord.js - Imagine an app
Created by Alcinzal on 7/16/2024 in #djs-questions
Send a dm to user after bot/app has been added/authorized? (user install)
But is redirects supposed to not work like that? Like applications.commands+identify does not work, and response_type=code doesnt authorize the app properly.
50 replies