mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-05-16 18:59:09 +00:00
Simplify examples to no longer use logging or Client.is_logged_in
The logging module is no longer required to get diagnostic output since we use `stderr` by default regardless of the logging module. Which means that the logging module will only give a more verbose output than is necessary. Client.is_logged_in checking is no longer necessary since all HTTP request handling now raise an exception if they fail so those chunks are also gone.
This commit is contained in:
parent
ea80812fdd
commit
af9e5bc67a
@ -1,16 +1,8 @@
|
||||
import discord
|
||||
import logging
|
||||
|
||||
# Set up the logging module to output diagnostic to the console.
|
||||
logging.basicConfig()
|
||||
|
||||
client = discord.Client()
|
||||
client.login('email', 'password')
|
||||
|
||||
if not client.is_logged_in:
|
||||
print('Logging in to Discord failed')
|
||||
exit(1)
|
||||
|
||||
@client.event
|
||||
def on_ready():
|
||||
print('Connected!')
|
||||
|
@ -1,16 +1,8 @@
|
||||
import discord
|
||||
import logging
|
||||
|
||||
# Set up the logging module to output diagnostic to the console.
|
||||
logging.basicConfig()
|
||||
|
||||
client = discord.Client()
|
||||
client.login('email', 'password')
|
||||
|
||||
if not client.is_logged_in:
|
||||
print('Logging in to Discord failed')
|
||||
exit(1)
|
||||
|
||||
@client.event
|
||||
def on_ready():
|
||||
print('Connected!')
|
||||
|
@ -1,17 +1,9 @@
|
||||
import discord
|
||||
import time
|
||||
import logging
|
||||
|
||||
# Set up the logging module to output diagnostic to the console.
|
||||
logging.basicConfig()
|
||||
|
||||
client = discord.Client()
|
||||
client.login('email', 'password')
|
||||
|
||||
if not client.is_logged_in:
|
||||
print('Logging in to Discord failed')
|
||||
exit(1)
|
||||
|
||||
@client.event
|
||||
def on_ready():
|
||||
print('Connected!')
|
||||
|
@ -1,16 +1,8 @@
|
||||
import discord
|
||||
import logging
|
||||
|
||||
# Set up the logging module to output diagnostic to the console.
|
||||
logging.basicConfig()
|
||||
|
||||
client = discord.Client()
|
||||
client.login('email', 'password')
|
||||
|
||||
if not client.is_logged_in:
|
||||
print('Logging in to Discord failed')
|
||||
exit(1)
|
||||
|
||||
@client.event
|
||||
def on_message(message):
|
||||
if message.content.startswith('!hello'):
|
||||
|
Loading…
x
Reference in New Issue
Block a user