📌  相关文章
📜  查看 BOT 所在的服务器名称 - 无论代码示例

📅  最后修改于: 2022-03-11 14:56:26.053000             🧑  作者: Mango

代码示例1
import discord
from discord.ext import commands

client = discord.Client
activeservers = client.guilds

class OwnerCommands(commands.Cog):

    def __init__(self, client):
        self.client = client

    @commands.Cog.listener()
    async def on_ready(self):
        print("OwnerCommands Is Ready")

    @commands.command()
    async def servers(self, ctx):
        await ctx.send(activeservers)
        print(activeservers)

def setup(client):
    client.add_cog(OwnerCommands(client))