Automatic change of Discord "About me" - python

THE PROBLEM:
In Discord, as you may know, there is an "About me" section.
This section is a description of a profile that you can write yourself.
Bots can have an "About me" section.
What I want to do is to edit this "About me" section automatically in discord.py;
For example, the "About me" section of the bot changes every hour.
WHAT I TRIED:
I searched for some answers for a long time but didn't find anything relevant.
I saw that you could modify the "about me" with the Developer portal, but it's not automated.
I saw that some people said "This will be able in discord.py V2" but didn't find it
It may be possible to resolve this problem with HTTP requests but it's only a supposition, I'm not very good at this topic.
CODE:
#bot.event
async def on_ready():
while 1:
await change_the_about_me_section(str(random.randint(0,1000))
time.sleep(3600)
# change_the_about_me_section isn't a real function
# I just wanted to show an exemple of what I wanted to do

There is an answer.
You can fully automate it with Python in a few lines.
With the requests library.
You just have to first include requests with:
import requests
Then, do a patch request
requests.patch(url="https://discord.com/api/v9/users/#me", headers= {"authorization": token}, json = {"bio": abio} )
# With token your token, and abio a string like "hello"
And... that's it :)
(Note: You can also do that with the color of the Account with accent_color instead of bio, and the banner with banner instead of bio)

I do not think you can change your about me using any code. It must be done through the developer portal. On the other hand, you can change its status through your code.

You can only do this as the application owner/a team member manually in the Developer Portal.
Automating this would count as automating your user account (eg. self-boting) wich is against Discords Terms of Service and can get your account banned.
The bot itself has no access to this endpoint.

You can’t change that via the api.
Bots don’t use the bio field.
And self bot is forbidden by the tos.

Related

How do I tweet from my bot account when the bot app is created under a separate account?

I'm quite a novice, so please excuse my ignorance.
I've created a developer account on my personal Twitter account and my end goal is to have another account occasionally tweet something. I'm using tweepy and have successfully managed to tweet something, albeit from my account.
Twitter developer accounts can get their API key and secret, as well as an Access key and secret. What I'm trying to figure out is how to get my bot account's keys to have it tweet instead of my account.
After reading countless pages online as well as the docs, there seems to be a way to get auth another user through three-legged auth and pin-based auth, which seems like the correct route to my goal.
However, I have no idea where to go from here. The three-legged auth page asks for various required fields, of which I have no idea what to fill with (Callback URLs and Website URL). Moreover, the docs describe the process as one that needs to be initiated by the dev account, and I have no idea how to initiate that process at all.
Any help or guidance on what to do? My tweepy script is fully finished and just needs to be hooked up to the Twitter API.
Thanks.
EDIT & SOLUTION (03/18/2021):
Thanks to the comment by Sim leading to the article, I was able to derive a python script using Tweepy to authorize the bot using pin-based auth, found here. I'd give the article a read regardless, but once it starts telling you to create .js and .json files, stop there and use my script. That's what worked for me.
Found a solution that worked for me, I think this is what you need. https://dev.to/stratospher/many-bot-accounts-using-1-twitter-developer-account-17ff

Remove phone Discord.py

I am currently testing with different selfbots on Discord.py. I wanted to know if there was a way to remove the phone number off my account. I tried bot.remove_phone but that didnt work. I am completely new to python.
Self botting is against the Terms and Service of Discord.
Moreover, Discord doesn't give out features to further hurt their platform by their API. If Discord happens to detect this your account would be banned. Either way, remove_phone attribute is not included in the Official Discord documentation.
But for clarity, anything considered "user account automation" is disallowed, including custom clients and similar.
Here's Discord's reference:
https://support.discord.com/hc/en-us/articles/115002192352-Automated-user-accounts-self-bots-
I cant make an comment so I have to make an answer, but you could make an requests.delete() to discord, you need the token and its password.
You can find more info about how the request should look like by being logged in discord via chrome, then open dev tools with ctrl + i -> go to network and select XHR then you can try and delete phone number with a wrong password to get an idea how the request should look like
also probably should not use your main since you might do couple mistakes and lose your account

Is there a way to differentiate between someone replying to you, and someone mentioning you directly on Twitter using Tweepy?

I'm working on a bot that does jobs for Twitter users. They're supposed to request help by mentioning my bot like "#bot" with any other options in the text, optional.
Problem is, Twitter seems to consider directly #'ing someone in a new standalone tweet like "#jake hey" and replying to a tweet that user #jake made, with "hey" to be the exact same thing. If I check the full_text field for each status on tweepy, they both appear as "#jake hey". My bot needs a user supplied video to do its job. So if my bot were to reply to someone with a finished job, someone could reply to my bot with a video as a reaction to it, perhaps a video where someone says "Thank you!", my bot would confuse that as someone trying to request it to analyze that video for it. I need to prevent this so I don't reply to that user who didn't actually want to submit the video to my bot. I can't seem to find a way to differentiate between these two tweet examples, they seem to be the same under the hood. I hope I explained it soundly enough. Any ideas what I can do?

Is there a way ot make a discord bot screen share a website

I'm looking for a way to make the bot screen share a website. And the link to be a parameter after the command. (To clarify: The website starting URL doesn't change. Only a token that's given after the starting URL. For example: "https://websitehere.com/branch/ 'token goes here'
Bots Can't Screenshare! Discord Bot API Do Not Support It Yet!
There is an alternative with selfbots using JavaScript, You can try this project:
https://www.youtube.com/watch?v=HA18QDE5GhQ
https://github.com/MainSilent/Discord-Screenshare
In order to show a website you need to capture it and show it on the html video element in stream_inject.js

get tweet when tagged in Tweepy

I'm working on an automatic text to speach generator using tweep and gTTS.
And what I'd like to is whenever a user tags my bot, my bot will reply with a generated TTS response of their tweet.
Example if Malcolm tweets "#bot Banana Bread" well the bot will reply to that tweet with a mp4 file of a voice saying "banana bread"
I think I could pull of the TTS generation with gTTS and some messing around.
However I don't know how I could automatically get the tweet Id and so the tweets text when I'm tagged.
The only method I see is to constantly refresh a
example = tweepy.Cursor(api.search, q='#bot').items(1)
and then
for tweet in example:
print tweet.text, tweet.id_str
and then store the id so that it only gets the latest posts and doesn't reply to the same tweet twice.
But this seems like a bit much, and I'm wondering if there's any faster/easier/more efficient way of doing this?
Your method is good : store tweet IDs you answered to, and check them before a new reply. With time, it can be a lot of IDs so you have to handle delete of very old ones.
Another way is to use the Twitter Account Activity API : via a webhook (an URL of your personnal web server), you can get mention events, then simply reply directly.
If i understand the official documentation, 1 free webhook is available with premium API.
Here is documentation :
https://developer.twitter.com/en/use-cases/engage#chatbots-and-automation
https://developer.twitter.com/en/docs/accounts-and-users/subscribe-account-activity/overview

Categories