make examples on_ready consistent

This commit is contained in:
pikaninja 2021-04-09 15:05:33 -07:00 committed by GitHub
parent eb5356cc47
commit 1952060e1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 12 additions and 20 deletions

View File

@ -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

View File

@ -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):

View File

@ -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))

View File

@ -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'):

View File

@ -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'):

View File

@ -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):

View File

@ -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):

View File

@ -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):