Registry / communication / discord-py-self

discord-py-self

JSON →
library2.1.0pypypi✓ verified 85d ago

A Python wrapper for the Discord user (self-bot) API, allowing automation of user accounts. Version 2.1.0 supports Python >=3.10. This library is not officially supported by Discord and is against Discord's Terms of Service, often leading to account bans. It uses a similar API to discord.py but for user accounts.

pip install discord-py-self
INSTALL
IMPORT
SIG · DISCORD-PY-SELF
D
discord-py-self
communicationpythonv2.1.0
Install
7.7s avg
Import
1053ms
Disk
75MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.1.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 1.262s · 84.3MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 7.7s · import 0.844s · 84MB
75MB installed
● package 75MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Client
from discord import Client
from discord_self import Client
Common mistake: using wrong package name.
commands.Bot
from discord.ext import commands
from discord.ext.commands import Bot
Correct import is from discord.ext, not discord.ext.commands directly.

Minimal self-bot using commands.Bot with self_bot=True and message content intents.

import discord from discord.ext import commands intents = discord.Intents.default() intents.message_content = True bot = commands.Bot(command_prefix='!', self_bot=True, intents=intents) @bot.event async def on_ready(): print(f'Logged in as {bot.user}') bot.run(os.environ.get('TOKEN', ''))
Debug
Known issues
breakingIn version 2.0+, Intents are required and must be passed explicitly. Old code without intents will fail with a TypeError.
fix
Add intents=discord.Intents.default() (or custom) when creating Client or Bot.
affects: >=2.0
deprecatedThe 'login' method is deprecated in favor of 'start' or 'run'. Using login() may break in future versions.
fix
Use bot.run(token) or await bot.start(token) instead of bot.login(token).
affects: >=2.0
gotchaThis library violates Discord's Terms of Service. Using it for self-botting can lead to permanent account suspension. Use at your own risk.
fix
Consider using a bot account with discord.py instead.
affects: all
Errors
Common errors & fixes
TypeError: __init__() missing 1 required positional argument: 'intents'
Intents are mandatory starting in version 2.0.0.
fix
Add intents=discord.Intents.default() to your Client or Bot constructor.
AttributeError: 'Bot' object has no attribute 'login'
The login method was removed in later versions of 2.x.
fix
Use bot.run(token) or await bot.start(token) instead.
Upgrade
Version history
2.1.0latest on PyPI · released Jan 18, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
31 hits · last 30 days
node
28
OpenAI (training)
1
Resources
discord-py-self — pip install discord-py-self · libregistry