Browse Source

make examples on_ready consistent

pull/6691/head
pikaninja 4 years ago
committed by GitHub
parent
commit
1952060e1a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      examples/background_task.py
  2. 4
      examples/background_task_asyncio.py
  3. 4
      examples/basic_voice.py
  4. 4
      examples/deleted.py
  5. 4
      examples/edits.py
  6. 4
      examples/guessing_game.py
  7. 4
      examples/new_member.py
  8. 4
      examples/reply.py

4
examples/background_task.py

@ -13,9 +13,7 @@ class MyClient(discord.Client):
self.my_background_task.start()
async def on_ready(self):
print('Logged in as')
print(self.user.name)
print(self.user.id)
print(f'Logged in as {self.user} (ID: {self.user.id})')
print('------')
@tasks.loop(seconds=60) # task runs every 60 seconds

4
examples/background_task_asyncio.py

@ -9,9 +9,7 @@ class MyClient(discord.Client):
self.bg_task = self.loop.create_task(self.my_background_task())
async def on_ready(self):
print('Logged in as')
print(self.user.name)
print(self.user.id)
print(f'Logged in as {self.user} (ID: {self.user.id})')
print('------')
async def my_background_task(self):

4
examples/basic_voice.py

@ -128,7 +128,9 @@ bot = commands.Bot(command_prefix=commands.when_mentioned_or("!"),
@bot.event
async def on_ready():
print(f'Logged in as {bot.user} ({bot.user.id})')
print('Logged in as')
print(bot.user.name)
print(bot.user.id)
print('------')
bot.add_cog(Music(bot))

4
examples/deleted.py

@ -2,8 +2,8 @@ import discord
class MyClient(discord.Client):
async def on_ready(self):
print('Connected!')
print(f'Username: {self.user.name}\nID: {self.user.id}')
print(f'Logged in as {self.user} (ID: {self.user.id})')
print('------')
async def on_message(self, message):
if message.content.startswith('!deleteme'):

4
examples/edits.py

@ -3,8 +3,8 @@ import asyncio
class MyClient(discord.Client):
async def on_ready(self):
print('Connected!')
print(f'Username: {self.user.name}\nID: {self.user.id}')
print(f'Logged in as {self.user} (ID: {self.user.id})')
print('------')
async def on_message(self, message):
if message.content.startswith('!editme'):

4
examples/guessing_game.py

@ -4,9 +4,7 @@ import asyncio
class MyClient(discord.Client):
async def on_ready(self):
print('Logged in as')
print(self.user.name)
print(self.user.id)
print(f'Logged in as {self.user} (ID: {self.user.id})')
print('------')
async def on_message(self, message):

4
examples/new_member.py

@ -4,9 +4,7 @@ import discord
class MyClient(discord.Client):
async def on_ready(self):
print('Logged in as')
print(self.user.name)
print(self.user.id)
print(f'Logged in as {self.user} (ID: {self.user.id})')
print('------')
async def on_member_join(self, member):

4
examples/reply.py

@ -2,9 +2,7 @@ import discord
class MyClient(discord.Client):
async def on_ready(self):
print('Logged in as')
print(self.user.name)
print(self.user.id)
print(f'Logged in as {self.user} (ID: {self.user.id})')
print('------')
async def on_message(self, message):

Loading…
Cancel
Save