python - discord.py 防止删除包含 #start 的消息
问题描述
#start
所以在我正在制作的机器人中,有一个循环可以删除任何在特定时间没有说的消息。但我希望它删除任何包含“#start”和其他任何内容的消息。因此,如果我要#start
在不和谐服务器上发送,机器人不会删除它,但如果我要发送一条消息说它#start testing
会删除该消息。我不知道该怎么做。这就是我想出的:
while hour >= 12 and hour < 14:
msg = await bot.wait_for_message(timeout=1, author=message.author)
if "#start" not in msg.content:
await bot.delete_message(msg)
hour = int(time.strftime("%H"))
它说即使我在将消息写入 csv 文件时可以使用它,它msg
也没有调用属性。content
那么有什么想法吗?我全是耳朵
解决方案
推荐阅读
- reactjs - Next.js,严格的 Typescript 和缺少/很难找到 RenderPageResult 类型
- angular - 默认情况下如何打开 ng bootstrap 下拉菜单
- c++ - Vector in an abstract class
- curl - 将 bitbucket 工件部署到下载
- object - 无法在 AX 表中添加字段,事件查看器显示对象名称存在
- python - pytorch cnn 模型停在 loss.backward() 没有任何提示?
- git - Git图:收集分支的提交
- angular - 当所有表单控件都有有效值时禁用表单按钮
- python - 将 Json 表转换为标准 df
- python - Python 多处理