Spaces:
Sleeping
Sleeping
Rifat Azad commited on
Commit ·
ccc39b8
1
Parent(s): d86db2c
added list command
Browse files- pydvpl_bot.py +15 -0
pydvpl_bot.py
CHANGED
|
@@ -583,6 +583,21 @@ async def stats(ctx):
|
|
| 583 |
await ctx.message.delete()
|
| 584 |
|
| 585 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 586 |
# UTILITY ADMIN_CMD ------------------------------------------------------ END
|
| 587 |
|
| 588 |
|
|
|
|
| 583 |
await ctx.message.delete()
|
| 584 |
|
| 585 |
|
| 586 |
+
@bot.command(help="List all servers the bot is on with their IDs")
|
| 587 |
+
async def list(ctx, list_type, *args):
|
| 588 |
+
if str(ctx.author.id) != AUTHORIZED_USER_ID:
|
| 589 |
+
await ctx.send("You are not authorized to use this command.")
|
| 590 |
+
await ctx.message.delete()
|
| 591 |
+
return
|
| 592 |
+
|
| 593 |
+
if list_type.lower() == 'servers':
|
| 594 |
+
if len(args) < 1:
|
| 595 |
+
servers_info = "\n".join([f"{server.name} - ID: {server.id}" for server in bot.guilds])
|
| 596 |
+
await ctx.send(f"List of servers the bot is on:\n```{servers_info}```")
|
| 597 |
+
await ctx.message.delete()
|
| 598 |
+
|
| 599 |
+
|
| 600 |
+
|
| 601 |
# UTILITY ADMIN_CMD ------------------------------------------------------ END
|
| 602 |
|
| 603 |
|