当前位置: 首页>>代码示例>>C#>>正文


C# ChatMessage.SendBotMessage方法代码示例

本文整理汇总了C#中ChatMessage.SendBotMessage方法的典型用法代码示例。如果您正苦于以下问题:C# ChatMessage.SendBotMessage方法的具体用法?C# ChatMessage.SendBotMessage怎么用?C# ChatMessage.SendBotMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ChatMessage的用法示例。


在下文中一共展示了ChatMessage.SendBotMessage方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ProcessCommand

        public override async Task<bool> ProcessCommand(ChatMessage msg, string command)
        {
            var files = Directory.GetFiles("G:\\Dropbox\\Public\\Pics\\pony", "*", SearchOption.AllDirectories).ToList();
            if (files.Count == 0)
                return true;

            //files = Directory.GetFiles("G:\\Dropbox\\Public\\Pics\\pony\\Luna\\NSFW", "*", SearchOption.AllDirectories).ToList();

            var random = new LunaRandom();

            var file = files[random.Next(files.Count)];

            var dropboxLink = await Utils.GetDropboxLinkForFilePath(file);

            bool nsfw = false;

            if (ConfigManager.Config.SFWOnly)
            {
                while (dropboxLink.Contains(@"/nsfw/"))
                    dropboxLink = await Utils.GetDropboxLinkForFilePath(file);
            }

            if (dropboxLink.Contains(@"/nsfw/", StringComparison.OrdinalIgnoreCase))
                nsfw = true;


            if(nsfw)
                msg.SendBotMessage("NSFW : " + dropboxLink);
            else
                msg.SendBotMessage(dropboxLink);

            return true;
        }
开发者ID:natfoth,项目名称:LunaSkypeBot,代码行数:33,代码来源:RandomCommand.cs

示例2: ProcessCommand

        public override async Task<bool> ProcessCommand(ChatMessage msg, string command)
        {
           // var chatHandler = msg.

            ChatClass chat = (ChatClass) msg.Chat;

            var chatname = chat.Name;

            var list = ConfigManager.GlobalConfig.LunaOfTheDayList;

            if (list.Contains(chatname))
            {
                ConfigManager.GlobalConfig.LunaOfTheDayList.Remove(chatname);
                msg.SendBotMessage("Removed from the Luna Of The Day List");
            }
            else
            {
                ConfigManager.GlobalConfig.LunaOfTheDayList.Add(chatname);
                msg.SendBotMessage("Registered to the Luna Of The Day List");
            }

            ConfigManager.GlobalConfig.Save();

            return true;
        }
开发者ID:natfoth,项目名称:LunaSkypeBot,代码行数:25,代码来源:LunaOfTheDayCommand.cs

示例3: ProcessCommand

        public override async Task<bool> ProcessCommand(ChatMessage msg, string command)
        {
            var parameter = GetParameter(command);
            var secondary = GetSecondaryParameter(command);

            int newAccessLevel;
            if (!int.TryParse(secondary, out newAccessLevel))
            {
                msg.SendBotMessage("Failed to parse new Access Level : ( " + secondary + " )" + " - For the user : ( " + parameter + " )");
                return true;
            }


            if (!ConfigManager.Config.AccessLevels.ContainsKey(parameter.ToLowerInvariant()))
            {
                ConfigManager.Config.AccessLevels.Add(parameter.ToLowerInvariant(), newAccessLevel);
            }
            else
            {
                ConfigManager.Config.AccessLevels[parameter.ToLowerInvariant()] = newAccessLevel;
            }

            msg.SendBotMessage("Set the Access Level for the User : ( " + parameter + " )" + " - To Level : ( " + newAccessLevel + " )");

            ConfigManager.Config.Save();

            // msg.SendBotMessage("Adding Quote : \"" + quoteToAdd + "\" - To Pony (" + pony + ")");

            return true;
        }
开发者ID:natfoth,项目名称:LunaSkypeBot,代码行数:30,代码来源:SetPermissionsCommand.cs

示例4: ProcessCommand

        public override async Task<bool> ProcessCommand(ChatMessage msg, string command)
        {
            if (ConfigManager.Config.CelestiaRetaliation)
            {
                msg.SendBotMessage("Celestial Retaliation!");
                msg.SendBotMessage(GetRandomCelestiaPic());
            }
            else
            {
                msg.SendBotMessage(GetRandomLunaPic());
            }


            return true;
        }
开发者ID:Nagato23,项目名称:LunaSkypeBot,代码行数:15,代码来源:LunaCommand.cs

示例5: ProcessCommand

        public override async Task<bool> ProcessCommand(ChatMessage msg, string command)
        {

            msg.SendBotMessage(GetRandomCelestiaPic());

            return true;
        }
开发者ID:Nagato23,项目名称:LunaSkypeBot,代码行数:7,代码来源:CelestiaCommand.cs

示例6: ProcessCommand

        public override async Task<bool> ProcessCommand(ChatMessage msg, string command)
        {
            var searchMessage = msg.SendBotMessage("Searching....");

            var searchTerms = "";

            if (command.StartsWith("s "))
                searchTerms = command.Remove(0, 1).Trim();
            else
            {
                searchTerms = command.Remove(0, 6).Trim();
            }


            var result = DatabaseManager.GetRandomImageSearch(searchTerms);

            if(result.Length == 0)
                searchMessage.EditMessage("No Results Found");
            else
            {
                searchMessage.EditMessage(result);
            }

            return true;
        }
开发者ID:natfoth,项目名称:LunaSkypeBot,代码行数:25,代码来源:SearchCommand.cs

示例7: ProcessCommand

        public override async Task<bool> ProcessCommand(ChatMessage msg, string command)
        {
            var parameter = GetParameter(command);

            if (ConfigManager.GlobalConfig.GlobalAdmins.Contains(parameter.ToLowerInvariant()))
            {
                msg.SendBotMessage("Global Admins already contains the user : " + parameter);
                return true;
            }
            else
            {
                ConfigManager.GlobalConfig.GlobalAdmins.Add(parameter.ToLowerInvariant());
                msg.SendBotMessage("Added the user : " + parameter + " - To the Global Admin List");

                ConfigManager.GlobalConfig.Save();
            }

           // msg.SendBotMessage("Adding Quote : \"" + quoteToAdd + "\" - To Pony (" + pony + ")");

            return true;
        }
开发者ID:Nagato23,项目名称:LunaSkypeBot,代码行数:21,代码来源:AddGlobalAdminCommand.cs

示例8: ProcessCommand

        public override async Task<bool> ProcessCommand(ChatMessage msg, string command)
        {
            var props = ConfigManager.Config.GetType().GetProperties();

            var removedCommand = command.Replace("setting", "").Trim();

            var variable = removedCommand.SubStringTillChar(" ").Trim();

            var removedVariableAndCommand = removedCommand.Replace(variable, "").Trim();

            var parameter = removedVariableAndCommand.Trim();

            if (!SettingsAllowedToChange.ContainsKey(variable.ToLowerInvariant()))
            {
                if(props.Any(prop => string.Equals(prop.Name, variable, StringComparison.InvariantCultureIgnoreCase)))
                    msg.SendBotMessage(variable + " - Is Not Allowed to be changed");
                else
                    msg.SendBotMessage("Setting : (" + variable + ") - Not Found");

                return true;
            }

            var accessLevelRequired = SettingsAllowedToChange[variable.ToLowerInvariant()];

            if (GetSenderAccessLevel(msg) < accessLevelRequired)
            {
                msg.SendBotMessage("You do not have access to change the variable (" +variable + ")");
                return true;
            }
            

            foreach (var prop in props)
            {
                if (prop.Name.ToLower() == variable.ToLower())
                {
                   if(prop.Name.ToLower().Contains("nickname"))
                   {
                        msg.SendBotMessage("Setting (" + variable + ") Is not allowed to be changed");
                        return true;
                   }

                    prop.SetValue(ConfigManager.Config, Convert.ChangeType(parameter, prop.PropertyType), null);
                    ConfigManager.Config.Save();

                    msg.SendBotMessage(prop.Name + " - set to : " + prop.GetValue(ConfigManager.Config));
                    return true;
                }

                //Console.WriteLine("{0}={1}", prop.Name, prop.GetValue(foo, null));
            }

            msg.SendBotMessage("Setting (" + variable + ") - Not Found");


            return true;
        }
开发者ID:Nagato23,项目名称:LunaSkypeBot,代码行数:56,代码来源:SettingsCommand.cs

示例9: ProcessCommand

        public override async Task<bool> ProcessCommand(ChatMessage msg, string command)
        {
            var parameter = "";

            if (command.StartsWith("quote"))
                parameter = command.ToLower().Replace("quote", "").Trim();
            else
                parameter = command.ToLower().Substring(1).Trim();

            var quote = GetRandomQuote(parameter);

            msg.SendBotMessage(quote);

            return true;
        }
开发者ID:Nagato23,项目名称:LunaSkypeBot,代码行数:15,代码来源:QuoteProcessor.cs

示例10: ProcessCommand

        public override async Task<bool> ProcessCommand(ChatMessage msg, string command)
        {
            if (IsFriendshipCannonRunning)
                return false;

            IsFriendshipCannonRunning = true;

            _msg = msg;

            var message = msg.SendBotMessage("Orbital Friendship Cannon - Online");

            await Task.Delay(TimeSpan.FromMilliseconds(3000));

            message.EditMessage("Acquiring Target.");

            await Task.Delay(TimeSpan.FromMilliseconds(2000));

            message.EditMessage("Acquiring Target..");

            await Task.Delay(TimeSpan.FromMilliseconds(500));

            message.EditMessage("Acquiring Target...");

            await Task.Delay(TimeSpan.FromMilliseconds(500));

            message.EditMessage("Acquiring Target...");

            await Task.Delay(TimeSpan.FromMilliseconds(500));

            message.EditMessage("Acquiring Target...");

            await Task.Delay(TimeSpan.FromMilliseconds(500));

            message.EditMessage("Target Locked");

            await Task.Delay(TimeSpan.FromMilliseconds(2000));

            message.EditMessage("Firing : " + "http://www.allmystery.de/i/t1ce2b1_FiringOrbitalFriendshipCannon.gif?bc");

            int asdf = 3;

            IsFriendshipCannonRunning = false;

            //Timer t = new Timer(AcquireTarget, 5, 0, 8000);

            return true;
        }
开发者ID:natfoth,项目名称:LunaSkypeBot,代码行数:47,代码来源:FriendshipCannonCommand.cs

示例11: ProcessCommand

        public override async Task<bool> ProcessCommand(ChatMessage msg, string command)
        {
            var whichCommand = GetCommand(command);
            var message = "";
            switch (whichCommand)
            {
                case "storm":
                    message = "Quick! Hide in the barn!";
                    break;
                case "kill":
                    message = "The Luna Natwork is not allowed to be disabled";
                    break;
            }

            if (message.Length == 0)
                return true;

            msg.SendBotMessage(message);

            return true;
        }
开发者ID:natfoth,项目名称:LunaSkypeBot,代码行数:21,代码来源:MiscCommands.cs

示例12: ProcessCommand

        public override async Task<bool> ProcessCommand(ChatMessage msg, string command)
        {
            var pony = GetParameter(command);
            var quoteToAdd = GetSecondaryParameter(command);


            if (!File.Exists("Quotes\\" + pony.ToLowerInvariant() + ".txt"))
            {
                //File.Create("Quotes\\" + pony + ".txt");

                File.WriteAllText("Quotes\\" + pony.ToLowerInvariant() + ".txt", quoteToAdd);
            }
            else
            {
                File.AppendAllText("Quotes\\" + pony.ToLowerInvariant() + ".txt", string.Format("{0}{1}", Environment.NewLine, quoteToAdd));
            }


            msg.SendBotMessage("Adding Quote : \"" + quoteToAdd + "\" - To Pony (" + pony + ")");

            return true;
        }
开发者ID:natfoth,项目名称:LunaSkypeBot,代码行数:22,代码来源:AddQuoteCommand.cs


注:本文中的ChatMessage.SendBotMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。