From b6ef2a756729af6da2630bf4b564c8a3c12f4f79 Mon Sep 17 00:00:00 2001 From: ishaan Date: Tue, 18 May 2021 19:49:39 -0400 Subject: [PATCH] Updated bot.py and pingCog.py --- bot.py | 7 +++++++ cogs/pingCog.py | 10 +++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/bot.py b/bot.py index 05d301a..7108f28 100644 --- a/bot.py +++ b/bot.py @@ -5,6 +5,13 @@ from discord.ext import commands TOKEN = os.environ.get("TOKEN") client = commands.Bot(command_prefix= 'd!') +@client.event +async def on_ready(): + print(f'{client.user.name} is ready.') + # print(f'Bot is in {len(client.guilds)} guilds.') + # print(f'Guilds have {len(client.users)} members.') + await client.change_presence(activity=discord.Streaming(name="Click the link!", url="https://www.youtube.com/watch?v=dQw4w9WgXcQ")) + @client.command() async def load(ctx, extension): client.load_extension(f'cogs.{extension}') diff --git a/cogs/pingCog.py b/cogs/pingCog.py index e25807f..40f3d28 100644 --- a/cogs/pingCog.py +++ b/cogs/pingCog.py @@ -6,15 +6,11 @@ class PingCog(commands.Cog): def __init__(self, client): self.client = client - # Events - @commands.Cog.listener() - async def on_ready(self): - print('Bot is online.') - # Commands @commands.command(aliases=['latency']) async def ping(self, ctx): - await ctx.send(f'Pong! {client.latency}ms') - + # await ctx.send(f'Pong! {client.latency}ms') + await ctx.send('Pong!') + def setup(client): client.add_cog(PingCog(client)) \ No newline at end of file