Skip to content

Commit

Permalink
Change all email/password pair examples to use token.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rapptz committed Apr 9, 2016
1 parent 93edf88 commit 72e84a1
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -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`.
Expand Down
2 changes: 1 addition & 1 deletion discord/client.py
Expand Up @@ -505,7 +505,7 @@ def login(self, *args):
.. code-block:: python
await client.login('email', 'password')
await client.login('token')
# or
Expand Down
6 changes: 3 additions & 3 deletions docs/migrating.rst
Expand Up @@ -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::

Expand All @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion examples/background_task.py
Expand Up @@ -23,7 +23,7 @@ async def on_ready():

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())
Expand Down
2 changes: 1 addition & 1 deletion examples/basic_bot.py
Expand Up @@ -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')
2 changes: 1 addition & 1 deletion examples/deleted.py
Expand Up @@ -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')
2 changes: 1 addition & 1 deletion examples/edits.py
Expand Up @@ -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')
2 changes: 1 addition & 1 deletion examples/guessing_game.py
Expand Up @@ -34,4 +34,4 @@ async def on_ready():
print(client.user.id)
print('------')

client.run('email', 'password')
client.run('token')
2 changes: 1 addition & 1 deletion examples/new_member.py
Expand Up @@ -15,4 +15,4 @@ async def on_ready():
print(client.user.id)
print('------')

client.run('email', 'password')
client.run('token')
2 changes: 1 addition & 1 deletion examples/playlist.py
Expand Up @@ -100,4 +100,4 @@ async def on_ready(self):


bot = Bot()
bot.run('email', 'password')
bot.run('token')
2 changes: 1 addition & 1 deletion examples/reply.py
Expand Up @@ -19,4 +19,4 @@ async def on_ready():
print(client.user.id)
print('------')

client.run('email', 'password')
client.run('token')

1 comment on commit 72e84a1

@b1naryth1ef
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tfw danny is bae

Please sign in to comment.