当我尝试运行bot时,它在字符串message.author.kick()中说“消息未定义”
public static void Main(string[] args)
{
string banner;
PrintBanner(banner = "This is whats supposed to be printed.");
}
public static void PrintBanner(string text)
{
// The text variable contains "This is whats supposed to be printed." now.
// You can perform whatever operations you want with it within this scope,
// but it won't alter the text the banner variable contains.
}
应该踢出邮件发件人
答案 0 :(得分:1)
message
在任何地方都没有定义。您可以使用msg =>
开始作用域,因此msg
是消息对象的已定义变量。
将message.author.kick();
更改为msg.author.kick();