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


C# Bot.Act方法代码示例

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


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

示例1: cmd_act

        public static void cmd_act(Bot bot, String ns, String[] args, String msg, String from, dAmnPacket packet)
        {
            if (args.Length < 2)
            {
                bot.Say(ns, String.Format("<b>&raquo; Usage:</b> {0}act <i>[#channel]</i> msg", bot.Config.Trigger));
            }
            else
            {
                String chan, mesg;

                if (!args[1].StartsWith("#"))
                {
                    chan = ns;
                    mesg = msg.Substring(4);
                }
                else
                {
                    chan = args[1];
                    mesg = msg.Substring(5 + args[1].Length);
                }

                lock (CommandChannels["send"])
                {
                    CommandChannels["send"].Add(ns);
                }

                bot.Act(chan, mesg);
            }
        }
开发者ID:DivinityArcane,项目名称:lulzBot,代码行数:29,代码来源:Act.cs

示例2: cmd_channels

        public static void cmd_channels(Bot bot, String ns, String[] args, String msg, String from, dAmnPacket packet)
        {
            String output = String.Empty;

            List<String> chans = new List<String>();

            try
            {
                foreach (var cd in Core.ChannelData.Values)
                    if (cd.Name != "chat:DataShare" && !cd.Name.StartsWith("pchat") && !cd.Name.StartsWith("login"))
                        chans.Add(Tools.FormatNamespace(cd.Name, Types.NamespaceFormat.Channel));

                chans.Sort();

                output += String.Format("<b>&raquo; I am currently residing in {0} channel{1}:</b><br/>", chans.Count, chans.Count == 1 ? "" : "s");

                output += String.Format("<b> &middot; [</b>{0}<b>]</b>", String.Join("<b>]</b>, <b>[</b>", chans));

                bot.Act(ns, output);
            }
            catch (Exception Ex)
            {
                if (Program.Debug)
                    bot.Say(ns, "Error: " + Ex.Message);
            }
        }
开发者ID:DivinityArcane,项目名称:lulzBot,代码行数:26,代码来源:Channels.cs

示例3: cmd_about

        public static void cmd_about(Bot bot, String ns, String[] args, String msg, String from, dAmnPacket packet)
        {
            String output = String.Empty;

            output += String.Format("<b>&raquo; I am a <a href=\"http://fav.me/d5uviwb\">{0}</a> v{1} <b><sup>{2}</sup></b>, written by :devDivinityArcane:<br/>&raquo;</b> I am owned by :dev{3}:<br/>", Program.BotName, Program.Version, Program.ReleaseName, bot.Config.Owner);
            output += String.Format("<b>&raquo;</b> I've disconnected {0} time{1}, while I've been running for {2}<br/>", Program.Disconnects, Program.Disconnects == 1 ? "" : "s", Tools.FormatTime(bot.uptime));

            bot.Act(ns, output);
        }
开发者ID:DivinityArcane,项目名称:lulzBot,代码行数:9,代码来源:About.cs

示例4: cmd_credits

        public static void cmd_credits(Bot bot, String ns, String[] args, String msg, String from, dAmnPacket packet)
        {
            String output = String.Empty;

            output += "&raquo; lulzBot is a bot written by :devDivinityArcane: <sup><i>Formerly Kyogo</i></sup> and it couldn't have been done without the following people:";
            output += "<br/><br/><b>Absolutely fucking no one!</b> <sub><sub>No, not really.</sub></sub><br/><br/>";
            output += ":devOrrinFox:, who thought of the name and inspired me to write the bot.<br/>";
            output += ":devDeathShadow--666:, for letting me look at n00ds of his sister when I did well.<br/>";
            output += ":devSubjectX52873M:, for teaching me quite a few fun things that bots could do, as well as proving that PHP sucks for bots. :cough: <sub><sub>Dante</sub></sub><br/>";
            output += ":devdoofsmack: and :devtwexler:, who wrote dAmnBot, which inspired me to write bots for dAmn.<br/>";
            output += ":devNoodleMan:, for writing NoodleBot and Gyn, which inspired me to do better, way back when.<br/>";
            output += ":develectricnet:, for writing Futurism, which gave me quite a few ideas on what to do for user<->bot interaction.<br/>";
            output += ":devphotofroggy:, for writing dAmnPHP and Contra, which gave me ideas on how to do certain things I was conflicted about.<br/>";
            output += "And the whole #Botdom team, who put up with my bullshit for many, many years!<br/>";
            output += "<br/>But, most of all, <b>you</b>, for continuing to use lulzBot and letting me know how I can improve it.";

            bot.Act(ns, output);
        }
开发者ID:DivinityArcane,项目名称:lulzBot,代码行数:18,代码来源:Credits.cs


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