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