Update bots/Enter_content.py
Browse files- bots/Enter_content.py +2 -1
bots/Enter_content.py
CHANGED
|
@@ -41,6 +41,7 @@ async def console_input_loop():
|
|
| 41 |
@bot.command(name='sid')
|
| 42 |
async def servers(ctx):
|
| 43 |
"""顯示機器人所在的所有伺服器及其頻道資訊"""
|
|
|
|
| 44 |
for index, guild in enumerate(bot.guilds):
|
| 45 |
# 伺服器名稱和ID
|
| 46 |
server_info += f"伺服器名稱: {guild.name}, ID: {guild.id}\n"
|
|
@@ -56,7 +57,7 @@ async def servers(ctx):
|
|
| 56 |
# 回傳伺服器及頻道資訊,分成多條訊息發送,避免超過 Discord 訊息長度限制
|
| 57 |
for chunk in [server_info[i:i+2000] for i in range(0, len(server_info), 2000)]:
|
| 58 |
await ctx.send(chunk)
|
| 59 |
-
|
| 60 |
async def list_servers_and_channels():
|
| 61 |
print("\n已加入的伺服器:")
|
| 62 |
for index, guild in enumerate(bot.guilds):
|
|
|
|
| 41 |
@bot.command(name='sid')
|
| 42 |
async def servers(ctx):
|
| 43 |
"""顯示機器人所在的所有伺服器及其頻道資訊"""
|
| 44 |
+
server_info = "" # 初始化 server_info 為空字串
|
| 45 |
for index, guild in enumerate(bot.guilds):
|
| 46 |
# 伺服器名稱和ID
|
| 47 |
server_info += f"伺服器名稱: {guild.name}, ID: {guild.id}\n"
|
|
|
|
| 57 |
# 回傳伺服器及頻道資訊,分成多條訊息發送,避免超過 Discord 訊息長度限制
|
| 58 |
for chunk in [server_info[i:i+2000] for i in range(0, len(server_info), 2000)]:
|
| 59 |
await ctx.send(chunk)
|
| 60 |
+
|
| 61 |
async def list_servers_and_channels():
|
| 62 |
print("\n已加入的伺服器:")
|
| 63 |
for index, guild in enumerate(bot.guilds):
|