Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

discord.py - Discord API "soft-ban" for Selfbot? It can only read its own messages

So today, all of a sudden, my Discord Selfbot stopped working. It has been running for weeks without any issue. All it does is monitoring the bot alerts from other channels and notify me if certain conditions are met.

Basically the problem is that when I print(message.content) I get empty string, and when I print(message.embeds) I get an empty list. This happens for any message that isn't sent by myself. Basically I can pull any message from any channel, but if it's not sent by me, I will see it empty. I can still print(message) and see its ID, author, etc., but can't retrieve the content/embeds.

I thought it was some sort of soft-ban from the Discord API (account didn't receive any warning and works normally), but then tryed to make a new account and got the same issue. I'm so confused and can't find out what's the cause of the problem... Unless they changed the API for everyone.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I've been playing with this for the past few weeks, and using tips and ideas all over the internet, I created a patched version of Discord.py for self-bots.

It seems that you need to do couple of things to get message.content & message.embeds working again:

  • Disable all Intents
  • Edit the IDENTIFY packet sent to Discord

My fork does all that, as well as obfuscate the user-agent and a few other things.

Check the README for things changed + credits.

Link: GitHub, PyPi


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...