Change all email/password pair examples to use token.

This commit is contained in:
Rapptz 2016-04-08 22:02:38 -04:00
parent 93edf88ee4
commit 72e84a1b47
11 changed files with 13 additions and 13 deletions

View File

@ -57,7 +57,7 @@ async def on_message(message):
await asyncio.sleep(5)
await client.send_message(message.channel, 'Done sleeping')
client.run('email', 'password')
client.run('token')
```
Note that in Python 3.4 you use `@asyncio.coroutine` instead of `async def` and `yield from` instead of `await`.

View File

@ -505,7 +505,7 @@ class Client:
.. code-block:: python
await client.login('email', 'password')
await client.login('token')
# or

View File

@ -292,14 +292,14 @@ Basically, before:
.. code-block:: python
client.login('email', 'password')
client.login('token')
client.run()
After:
.. code-block:: python
client.run('email', 'password')
client.run('token')
.. warning::
@ -321,7 +321,7 @@ event loop then doing so is quite straightforward:
@asyncio.coroutine
def main_task():
yield from client.login('email', 'password')
yield from client.login('token')
yield from client.connect()
loop = asyncio.get_event_loop()

View File

@ -23,7 +23,7 @@ loop = asyncio.get_event_loop()
try:
loop.create_task(my_background_task())
loop.run_until_complete(client.login('email', 'password'))
loop.run_until_complete(client.login('token'))
loop.run_until_complete(client.connect())
except Exception:
loop.run_until_complete(client.close())

View File

@ -62,4 +62,4 @@ async def _bot():
"""Is the bot cool?"""
await bot.say('Yes, the bot is cool.')
bot.run('email', 'password')
bot.run('token')

View File

@ -19,4 +19,4 @@ async def on_message_delete(message):
fmt = '{0.author.name} has deleted the message:\n{0.content}'
await client.send_message(message.channel, fmt.format(message))
client.run('email', 'password')
client.run('token')

View File

@ -21,4 +21,4 @@ async def on_message_edit(before, after):
fmt = '**{0.author}** edited their message:\n{1.content}'
await client.send_message(after.channel, fmt.format(after, before))
client.run('email', 'password')
client.run('token')

View File

@ -34,4 +34,4 @@ async def on_ready():
print(client.user.id)
print('------')
client.run('email', 'password')
client.run('token')

View File

@ -15,4 +15,4 @@ async def on_ready():
print(client.user.id)
print('------')
client.run('email', 'password')
client.run('token')

View File

@ -100,4 +100,4 @@ class Bot(discord.Client):
bot = Bot()
bot.run('email', 'password')
bot.run('token')

View File

@ -19,4 +19,4 @@ async def on_ready():
print(client.user.id)
print('------')
client.run('email', 'password')
client.run('token')