问题描述
我正在尝试发出不和谐的机器人提醒命令,但是,我遇到了一个问题.
I am trying to make a discord bot reminder command, however, I am running through an issue.
当我执行命令时,它完美地执行了睡眠时间,但是,它没有显示我设置的提醒.
When I do the command, it executes the sleep time perfectly, however, it doesn't show the reminder that I have set.
示例:当我执行/reminder 5m Fix the server
时,它应该发送好吧,我会在5分钟后提醒你Fix the server.
,但是,它正在发送此信息:好的,我会在 5 分钟内提醒您有关 {}.
而且当我不包含提醒参数时,它应该发送一条错误消息,但它什么也不做.
Example: When I do /reminder 5m Fix the server
, it should send Alright, I will remind you about Fix the server in 5 minutes.
, However, it is sending this instead: Alright, I will remind you about {} in 5 minutes.
And also when I don't include the reminder argument it should send an error message, but it does nothing instead.
这是我的代码:
任何帮助将不胜感激,在此先感谢.
Any help would be appreciated, thanks in advance.
推荐答案
我通过改变一些s"解决了你的问题在你的代码中.所以这是新代码:
I solved your question with changing a few thing"s" in your code. So here is the new code:
首先,我不知道是什么导致了问题,但是你无缘无故地使用了 for 循环,这是不必要的.然后你不必创建 4 次嵌入,你可以使用 add_field
.所以它现在有效.如果仍有问题,请发表评论.
First of all, I don't know what causes the problem but you use a for loop for no reason, it's unnecessary. Then you don't have to create embeds for 4 times, you can just use add_field
. So it works now. If you still have problem, just comment.
这篇关于discord.py 中的提醒命令问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!