done some shit

This commit is contained in:
DasMoorhuhn 2024-02-16 02:43:26 +01:00
parent acebb8aab2
commit 423fba750f

View File

@ -31,7 +31,6 @@ logger.addHandler(handler)
# Init Addons
programmer_excuses = ProgrammerExcuses()
# redditProgrammerHumor = RedditProgrammerHumor()
xkcd = XKCD()
@ -73,27 +72,27 @@ async def change_presence(interval_in_seconds=120):
@bot.event
async def on_ready():
start_time = get_date_time()[2]
await bot.loop.create_task(change_presence())
logger.info(f"Logged in as: {bot.user.name} with ID {bot.user.id}")
await bot.loop.create_task(change_presence())
await bot.change_presence(activity=Game(name="with penguins"), status=Status.online)
await tree.sync()
@bot.event
async def on_guild_join(guild: Guild):
logger.debug("Added to Guild")
logger.info("Added to Guild")
await guild.system_channel.send("Hii^^")
@tree.command(name='excuse', description='Get a random excuse from programmingexcuses')
async def slash(interaction: Interaction):
logger.debug("Command: excuse")
logger.info("Command: excuse")
await interaction.response.send_message(programmer_excuses.get_excuse())
@tree.command(name='get-latest-comic', description='Get latest comic from XKCD')
async def slash(interaction: Interaction):
logger.debug("Command: get-latest-comic")
logger.info("Command: get-latest-comic")
comic = xkcd.get_last_comic()
embed = discord.Embed(title=comic.title, color=Color.blue(), url=f"{xkcd.url}/{comic.num}")
@ -103,7 +102,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.debug("Command: get-random-comic")
logger.info("Command: get-random-comic")
comic = xkcd.get_random_comic()
embed = discord.Embed(title=comic.title, color=Color.blue(), url=f"{xkcd.url}/{comic.num}")
@ -119,7 +118,7 @@ async def slash(interaction: Interaction):
@tree.command(name="info", description="get info about this bot")
async def slash(interaction: Interaction):
logger.debug("Command: info")
logger.info("Command: info")
time_now = get_date_time()[2]
uptime = time_now - start_time
@ -138,7 +137,7 @@ async def slash(interaction: Interaction):
@tree.command(name="help", description="List of all Commands")
async def slash(interaction: Interaction):
logger.debug("Command: help")
logger.info("Command: help")
command_list_string = ""
command_list_string += "`/info` : Get infos about the server and the Bot\n"
command_list_string += "`/help` : Get this view\n"
@ -167,4 +166,4 @@ try:
except Exception as err:
raise err
finally:
logger.debug("Stopped")
logger.info("Stopped")