THE PROBLEM:
In Discord, as you may know, there is a "About me" section.
This section is as description of a profile that you can write yourself.
Bots can have a "About me" section.
What I want, is to edit this "About me" section automatically in discord.py; For example, Every hours, the "about me" section of the bot change.
WHAT I TRIED:
I searched for a very long time some answers, but didn't find anything relevant.
I saw that you can modify the "about me" with the Developer portal, but it's not automate.
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 probleme with HTTP requests but it's only a supposition, I'm not very good in this topic.
SHOW SOME 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
CodePudding user response:
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.
CodePudding user response:
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
)