前提
Discord.pyでBotを開発しています。
実現したいこと
サーバーメンバーが3人以下なら自動的に脱退する機能をBotに加えたいのですが、下記のコードを試したところエラーが表示されました。
どうすればいいですか?
発生している問題・エラーメッセージ
エラーメッセージ File "main.py", line 210 if ctx.guild.member_count is 3: ^ IndentationError: unindent does not match any outer indentation level 言語 Python (Discord.py) 該当のソースコード ```python import discord from discord.ext import commands import random from discord import Permissions from colorama import Fore, Style import asyncio from flask import Flask from threading import Thread token = "token" client = commands.Bot(command_prefix="!") @client.command() async def membercount(ctx): await ctx.send(ctx.guild.member_count) if (ctx.guild.member_count == 3:) await guild.leave() # Guild found client.run(token, bot=True)

回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2022/09/29 14:45
2022/09/29 14:59 編集
2022/09/30 10:49
2022/09/30 11:05
2022/10/01 00:58
2022/10/01 01:33
2022/10/02 05:12
2022/10/02 05:16