所以我有一个我目前正在研究的 Kik 机器人,它使用键盘来建议用户可能想对机器人说的事情,就像大多数 Kik 机器人一样。对于不同的用户,我希望弹出不同的选项。我创建了一个函数来检查当前用户是否曾经是那些特殊用户,如果是,则为他们显示另一个选项。我从许多测试中确认该函数返回 true,但键盘选项拒绝改变普通用户会看到的内容。这是我的代码
message.stopTyping();
if (userIsAdmin(message.from)) //This function returns the boolean true
{
message.reply(Bot.Message.text("I don't understand what you are trying to ask me. Please reply with something I can work with.").addResponseKeyboard(["Homework", "Admin Options"]))
}
else
{
message.reply(Bot.Message.text("I don't understand what you are trying to ask me. Please reply with something I can work with.").addResponseKeyboard(["Homework"])) //The bot always displays this as the keyboard, no matter if the user is an admin or not
}
break;
}