如何检查用户是否存在于 Dsharplus (C# discord bot)

时间:2021-05-19 03:28:09

标签: c# c#-4.0 discord dsharp+

基本上我希望如果有人输入“whois(提及用户)”,机器人会发送一条消息,例如“(第一条消息中提到的用户)是(来自数组的随机消息)” 我只需要知道两件事 如果是实际提到的用户,我如何仅发送消息 以及如何仅在提及某个用户(我的光盘帐户)时才设置变量

        [Description("Mention someone after and it will tell you all about them")]
        public async Task WhoIs(CommandContext ctx, [Description("Mention a User")] string name)
        {   string[] descriptions = {"", "", "", "", ""};
            Random rng = new Random();
            int rngOk = rng.Next(descriptions.Length);
            //if (name == "a certain user")
            //{
            //    rngOk = 3;
            //}
            await ctx.Channel.SendMessageAsync(name + descriptions[rngOk]).ConfigureAwait(false);
        }

这是我目前的代码 如果您需要任何其他信息,请询问 任何帮助将不胜感激

0 个答案:

没有答案