Discord.py: Login as me and not as a bot

Created on 22 Nov 2017  路  17Comments  路  Source: Rapptz/discord.py

Is it possible via this module to connect as a user and not as a bot ?

If yes, what kind of token i've to send ? the oauth token or the browser local storage token ?

Thanks, great package btw (for bots at least).

Most helpful comment

Great, ty !

Working with this snippet:

#!/usr/bin/env python


import discord
import asyncio

TOKEN_AUTH = "YOUR Authorization TOKEN" # Retrieved from browser local storage

client = discord.Client()

@client.event
async def on_ready():
    print(client.servers)

client.run(TOKEN_AUTH, bot=False)


All 17 comments

http://discordpy.readthedocs.io/en/latest/api.html#discord.Client.login
await client.login('email', 'password')
Bear in mind that botting user accounts will get your account terminated

The goal is to make a plugin for weechat, people will use this with their accounts.

What do you mean by terminated ?

then i don't think you will have any problems. account termination may occur if you create bots that appear as normal users instead of bot users

 $ python /tmp/lol.py                                                                                                                                                                 
  File "/tmp/lol.py", line 21
    await client.login(EMAIL, PASSWORD)
               ^
SyntaxError: invalid syntax
$ python --version
Python 3.6.2

@marios8543 Okay I see now :)

Just specify bot=False in client.run. Don't pass your email and password because that's not allowed (deprecated a while ago).

Do note that user-bots and self-bots are against ToS.

(for the record, await can only be used inside async def)

Great, ty !

Working with this snippet:

#!/usr/bin/env python


import discord
import asyncio

TOKEN_AUTH = "YOUR Authorization TOKEN" # Retrieved from browser local storage

client = discord.Client()

@client.event
async def on_ready():
    print(client.servers)

client.run(TOKEN_AUTH, bot=False)


The project is finished ! :')

Weechat don't support python3 so I can't use asyncio for my plugin :(

it supports it only for tests, and may be unstable with other plugins

http://discordpy.readthedocs.io/en/latest/api.html#discord.Client.login
await client.login('email', 'password')
Bear in mind that botting user accounts will get your account terminated

Will my account be terminated if I write a program to say things on my behalf whenever I run it?

@codyle61: Yep, that's the definition of self botting, and it's against the ToS.

It's against ToS but it isn't an instant-ban feature. Further, it's presently broken without some adjustments due to a change on the API side.

Would that definition of self boting mean macros and such are self boting? I used to use AHK for phrases I'd type often or to assist me when explaining something (also for dumb ascii messages and such)

Do you mean if you type 'idk' your self-bot will auto correct to 'I Dont Know' once the message is sent?

Please don't necro-bump old closed issues.
Self-bots on user accounts are indeed forbidden now.
For further information and clarification, you should contact Discord Support.

Is python the only way you can selfbot now?
Can you use Node JS?

@MutantRabbit767 Please don't necrobump old issues.

GitHub issues for this repository should be used to report issues with this library.
They are not a medium for requesting help with Python, and certainly not for requesting help with userbots as they are against TOS.

For further help specific to using this library, you should join either the official discord.py server or the Discord API server, as the README recommends.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ThePiGuy24 picture ThePiGuy24  路  17Comments

AceKiron picture AceKiron  路  23Comments

VoxelPrismatic picture VoxelPrismatic  路  16Comments

pappabewar picture pappabewar  路  26Comments

johndoe434 picture johndoe434  路  21Comments