question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Self-bot can only see its own messages

See original GitHub issue

Summary

When using a self-bot, message.content and message.embeds are both empty. This does not occur on a real bot. I can still view information such as message.author.id, etc.

Reproduction Steps

  1. Run a simple bot with a user token (NOT a bot token).
  2. Add the on_message event.
  3. Add a command or some sort of response to a message, or just print(message.content)

Minimal Reproducible Code

import discord

class MyClient(discord.Client):
    async def on_ready(self):
        print('Logged on as', self.user)

    async def on_message(self, message):
        if message.content == 'ping':
            await message.channel.send('pong')

client = MyClient()
client.run('token', bot=False)

Expected Results

It responds to the command / prints the contents of the message.

Actual Results

It doesnt respond to anyone but itself / message.content is blank. Screenshot 2021-05-02 17 34 28

Intents

None, I don’t think they work for self-bots either.

System Information

  • Python v3.8.9-final
  • discord.py v1.7.1-final
  • aiohttp v3.7.4.post0
  • system info: Linux 5.4.0-1042-gcp #45-Ubuntu SMP Tue Apr 13 01:44:53 UTC 2021

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

I know self-bots are against ToS, and I accept the risks related to that.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
apple502jcommented, May 2, 2021

Easy fix: don’t use selfbots Or: run pip3 install -U git+https://github.com/Rapptz/discord.py

0reactions
Rapptzcommented, May 3, 2021

User-bots and self-bots have been deprecated in the library since v1.7 and will no longer receive support. As of v2.0, they have been completely removed from the library as well. Consider using a real bot instead.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Discord API "soft-ban" for Selfbot? It can only read its own ...
Basically I can pull any message from any channel, but if it's not sent by me, I will see it empty. I can...
Read more >
Bring back our selfbots! - Discord Support
i.e. it can't manipulate others' messages), the selfbot cannot create its own messages, read history, etc. There could be a few options in...
Read more >
discum - PyPI
A simple, easy to use, non-restrictive, synchronous Discord API Wrapper for Selfbots/Userbots written in Python. -using requests and websockets :) https://files ...
Read more >
How to Delete All Messages in Discord - Alphr
1. One of the simpler methods to deleting all messages in a channel is to delete the channel. But you may not want...
Read more >
I want to automatically post a message every 24 hours on my ...
Use Google to find out how to get yours. You would need a server the self-bot will be running on, unless you have...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found