<p>嗨,我有一些问题的代码,我得到一个类型错误
哪个是<code>TypeError: 'bool' object is not iterable</code>我应该使用<code>if</code>状态而不是<code>for</code>语句?在</p>
<p>我要实现的是,如果一条消息被固定了7天或更长时间,那么就取消固定该消息。在</p>
<p>我的工作是:</p>
<pre><code>async def on_message(self, message):
"""Listen for a message then unpin any other messages older than 7 days"""
server = message.server
channelid = '490899209067823135'
limit_date = datetime.now() - timedelta(days=7)
if server:
for message.content in message.channel.id == channelid:
if limit_date:
try:
await self.bot.unpin_message(message)
except discord.Forbidden:
print("No permissions to do that!")
</code></pre>
<p>我不知道我哪里出错了。在</p>