Advertisement
LyndenSylvester

Untitled

Nov 21st, 2024
43
0
18 hours
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.99 KB | None | 0 0
  1.  # Get Server Database Scheduler Tasks
  2.     @admin.command(name="get_server_db_specs", description="Get the specs of the server db")
  3.     async def get_server_db_specs(self, interaction: discord.Interaction) -> None:
  4.         guild_id = interaction.guild.id
  5.         ServerName = await asyncio.to_thread(utils.get_server_name, guild_id)
  6.         BasePath = await asyncio.to_thread(utils.server_folder, ServerName)
  7.         ShortServerName = await asyncio.to_thread(utils.shorten_server_name, guild_id)
  8.         rows = await Scheduler.classm(guild_id).load_tasks(guild_id)
  9.        
  10.         description_field = ""
  11.         for row in rows:
  12.             name, func_name, interval, last_run, next_run = row
  13.             description_field += f"name: {name} | func_name: {func_name} | interval: {interval} | last_run: {last_run} | next_run: {next_run} \n"
  14.  
  15.         em = discord.Embed(title="Scheduler table", description=description_field)
  16.  
  17.         await interaction.response.send_message(embed=em, ephemeral=True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement