@rensly

Непонятная ошибка discord.py?

Пишу код для информации о сервере но бот просто игнорит, ошибки нету.

# server
@bot.command()
async def server(ctx):
    find_bots = sum(1 for member in ctx.guild.members if member.bot)
    members = len([m for m in ctx.guild.members if not m.bot])
    categories = len(ctx.guild.text_channels + ctx.guild.voice_channels)
    channels = len(ctx.guild.text_channels)
    voices = len(ctx.guild.voice_channels)

    e = discord.Embed(title=f"Information about {ctx.guild.name}", color = color, timestamp = ctx.message.created_at)

    if ctx.guild.banner:
        e.add_image(url=ctx.guild.banner_url)

    e.set_thumbnail(url=ctx.guild.icon_url)
    e.add_field(
        name="About members", 
        value=f"""
        <:members_total:865163555614228481> Total: {ctx.guild.members}
        <:bot:865163555878469652> Bots: {find_bots}
        <:members:865163555698245652> Members: {members}""", inline=True)
    e.add_field(
        name="About channels", 
        value=f"""
        <:members_total:865163555614228481> Categories: {categories}
        <:bot:865163555878469652> Channels: {channels}
        <:members:865163555698245652> Voices: {voices}""", inline=True)
    e.add_field(name="Owner", value=ctx.guild.owner, inline=True)
    e.add_field(name="Регион", value=ctx.guild.region, inline=True)
    e.add_field(name="Создан", value=default.date(ctx.guild.created_at), inline=True)
    e.add_field(name="Текст каналов", value=len(ctx.guild.text_channels), inline=True)
    e.add_field(name="Голосовых каналов", value=len(ctx.guild.voice_channels), inline=True)
    e.set_footer(text = f'Requested by: {ctx.author.name}', icon_url = ctx.author.avatar_url)
    await ctx.reply(embed=e, mention_author=False)
  • Вопрос задан
  • 256 просмотров
Пригласить эксперта
Ответы на вопрос 1
Vindicar
@Vindicar
RTFM!
Попробуй завернуть код в try: catch: с выводом текста ошибки, и расставь отладочные print'ы. Так хотя бы поймешь, передаётся ли вообще управление в обработчик.
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы