Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Get Server Database Scheduler Tasks
- @admin.command(name="get_server_db_specs", description="Get the specs of the server db")
- async def get_server_db_specs(self, interaction: discord.Interaction) -> None:
- guild_id = interaction.guild.id
- ServerName = await asyncio.to_thread(utils.get_server_name, guild_id)
- BasePath = await asyncio.to_thread(utils.server_folder, ServerName)
- ShortServerName = await asyncio.to_thread(utils.shorten_server_name, guild_id)
- rows = await Scheduler.classm(guild_id).load_tasks(guild_id)
- description_field = ""
- for row in rows:
- name, func_name, interval, last_run, next_run = row
- description_field += f"name: {name} | func_name: {func_name} | interval: {interval} | last_run: {last_run} | next_run: {next_run} \n"
- em = discord.Embed(title="Scheduler table", description=description_field)
- await interaction.response.send_message(embed=em, ephemeral=True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement