From 7c6f1f84e2fd661540864a2c5e660e5ba4a3bd06 Mon Sep 17 00:00:00 2001 From: DasMoorhuhn Date: Fri, 3 Mar 2023 00:53:51 +0100 Subject: [PATCH] neee --- src/main.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main.py b/src/main.py index f053717..efb9fe7 100644 --- a/src/main.py +++ b/src/main.py @@ -58,17 +58,17 @@ startTime = getDateTime()[2] bot = client(intents=discord.Intents.all()) tree = app_commands.CommandTree(client=bot) -async def chnagePresence(): +async def chnagePresence(intervalInSeconds=60): while True: await bot.change_presence(activity=Game(name="with penguins"), status=Status.online) - await asyncio.sleep(20) + await asyncio.sleep(intervalInSeconds) countGuilds = 0 async for guild in bot.fetch_guilds(): countGuilds += 1 await bot.change_presence(activity=Game(name=f"on {countGuilds} Servers"), status=Status.online) - await asyncio.sleep(20) + await asyncio.sleep(intervalInSeconds) @bot.event async def on_ready(): @@ -87,10 +87,12 @@ async def on_guild_join(guild: Guild): @tree.command(name='excuse', description='Get a random excuse from programmingexcuses') async def slash(interaction: Interaction): + logger.info("Command: excuse") await interaction.response.send_message(programmerExcuses.getExcuse()) @tree.command(name='get-latest-comic', description='Get latest comic from XKCD') async def slash(interaction: Interaction): + logger.info("Command: get-latest-comic") comic = xkcd.getLastComic() embed = discord.Embed(title=comic.title, color=Color.blue(), url=f"{xkcd.url}/{comic.num}") @@ -99,6 +101,7 @@ async def slash(interaction: Interaction): @tree.command(name='get-random-comic', description='Get a random comic from XKCD') async def slash(interaction: Interaction): + logger.info("Command: get-random-comic") comic = xkcd.getRandomComic() embed = discord.Embed(title=comic.title, color=Color.blue(), url=f"{xkcd.url}/{comic.num}") @@ -124,7 +127,7 @@ async def slash(interaction: Interaction): botString += f"Developer : DasMoorhuhn.py#2604\n" botString += f"Sourcecode: https://gitlab.com/HendrikHeine/tux-discord-bot" - embed = discord.Embed(title=f"Info", description="about this Server", timestamp=datetime.datetime.utcnow(), color=Color.blue()) + embed = discord.Embed(title=f"Info", description="about this Bot", timestamp=datetime.datetime.utcnow(), color=Color.blue()) #embed.set_thumbnail(url=interaction.guild.icon) embed.add_field(name="Bot", value=botString, inline=False) await interaction.response.send_message(embed=embed)