Discord.py | Getting info about user connected accounts - python

I have Discord bot written on Python and I'm working on command that could show info about ur steam acc. Rn it asks for writing ID manually.
But how can I get ID of user's Steam account if user has it connected to their Discord acc? Is there any method for it?

What you are looking for is the parameter connected_accounts, this will retrieve a list of dictionaries showing the accounts connected to that user.
One thing to point out is that due to Discord limitations (bots cannot access User.Profile), discord.py does not currently allow a bot account to use this function (it will always return None), so to use it you would need to be in a user bot account, which are against Discord terms of service.

Related

How to use a user account to fetch/get messages (discord.py)

I have 2 discord client instances a bot and a user account. I have already figured out how to copy messages from one channel to another channel, basically a on_message event. However, I want to know if there is a way I can use the user account to fetch the messages, I've tried fetching messages in different guilds but they didn't work because the bot was not in the server and the bot is fetching messages. I've tried using the user account instance to do it but it didn't really work.
The comments were there as a guide for myself because I'm not that familiar with Python it's fairly new to me. If anyone knows how I can use the user account to get or fetch the messages I'd appreciate the help...
PS: I know that some of the code isn't needed, I haven't removed anything that isn't needed. I wanted to actually finish the project before inspecting it.
I just wanted to know that I have tried this myself and it is not possible. Because from discord.py's Docs. Which you can find down below, does not allow users (user account) to transfer data to a bot since you would need to request from discord API which leads to user getting banned (Very quickly) theere are some work arrounds but I would suggest not doing so since self botting is against the TOS of discord
https://discordpy.readthedocs.io/en/stable/
EDIT: Another thing is that discord API blocks users from fetching or getting anything using a user account with discord.py

How to access discord messages from main account instead of bot account

I've got a bluetooth RGB bulb that I want to use for notifications in discord. It seems that following standard guides I would need to get an admin to add a bot account to each discord I wanted this functionality in.
Is there a way to get access to messages accessible in my main account without getting another account/bot added? I only need to be able to read out the messages so I can parse them and trigger RGB stuff.
I would prefer to do this in python if possible but other solutions are fine if need be.
Self bots are against discord's TOS.
You can try using on_message(message) and using that to parse the message.content

Retrieve user ID from conversation with slack bot

I'm trying to get the slack UserId of the user who initiated a conversation with a bot.
I tried using users.identity scope and api, but I'm only getting the UserId of the user who created the bot. The bot will be used by multiple users so I want to have an isolated chat for each user by getting the exact UserId of the user who is currently having a conversation with the bot.
I'm using Python, Amazon Lex and Slack.
Can somebody point me to the right path?
If the conversation is initiated as a direct message with the bot, you can subscribe to message.im event. You'll receive this event every time a user sends a message to the bot. In the response JSON body, event.user should provide you the userId.
It could be a different solution depending upon how you are making the app, and where do you need this information.

How To Get Information From Discord User ID / Name Even If The User Is Not Within The Server In Discord Python

I currently wanna make a discord bot that needs information from user inside ( and outside ) the server
I have a few discord id and discord user i wanna get informations from like
profile picture,current username,last online,and online status
i have found the following website https://discord.id/ however it has recaptcha so i can't really use it for my bot however i'm curious as to how the website is able to grab those data
Use this
await client.fetch_user(user.id)

channel_not_found error while sending a message to myself

I'm using python3.6 and trying to send message to myself to start interacting in slack.
I've installed pip install slackclient and am using slackclient v2.2.1
channel ID is extracted from slack link of my account https://XXXXX.slack.com/messages/XXXXXXXXX
I would like to see Hi message in my slack account. any suggestions.
client = slack.WebClient("BOT_USER_TOKEN", timeout=30)
client.chat_postMessage(
channel='CHANNEL_ID',
text='Hi!')```
The bot user token is linked to a bot user that is created with your app. If you use the bot token you will only have access to channels that this bot user is a member of.
So to make your script work you need to do one of the following:
Use the access token instead of the bot token (that one is linked to the user that installed the Slack app)
Invite the bot user to the channel you are trying to send a message to
As you want to start with basics, I would recommend to use public channels first, which will always work.
Direct messages are a little bit more complicated. To send a direct message to a user (e.g. from your bot user to yourself) you need to first open a direct message channel with conversations.open, which will give you a new channel ID. And then use that channel ID for sending a message.

Categories