• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# SmartIrc4net.IrcMessageData类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Meebey.SmartIrc4net.IrcMessageData的典型用法代码示例。如果您正苦于以下问题:C# IrcMessageData类的具体用法?C# IrcMessageData怎么用?C# IrcMessageData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IrcMessageData类属于Meebey.SmartIrc4net命名空间,在下文中一共展示了IrcMessageData类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Execute

        public override void Execute(IrcMessageData data)
        {
            int start = data.Message.IndexOf(Name, StringComparison.CurrentCultureIgnoreCase) + Name.Length + 1;
            if (data.Message.Length <= start)
            {
                plugin.Host.Reply(data, SendType.Message, "No such command");
                return;
            }

            int end = data.Message.IndexOf(' ', start);
            if (end <= start)
            {
                end = data.Message.Length;
                if (end <= start)
                {
                    plugin.Host.Reply(data, SendType.Message, "No account specified");
                    return;
                }
            }

            string account = data.Message.Substring(start, end - start);

            plugin.RemoveAccount(account);
            plugin.Host.Reply(data, SendType.Message, "Account deleted");
        }
开发者ID:GGulati,项目名称:IRCBot,代码行数:25,代码来源:DeleteAccount.cs


示例2: Execute

        public override void Execute(IrcMessageData data)
        {
            int start = data.Message.IndexOf(Name, StringComparison.CurrentCultureIgnoreCase) + Name.Length + 1;
            if (data.Message.Length <= start)
            {
                plugin.Host.Reply(data, SendType.Message, "No such command");
                return;
            }

            int end = data.Message.IndexOf(' ', start);
            if (end <= start)
            {
                end = data.Message.Length;
                if (end <= start)
                {
                    plugin.Host.Reply(data, SendType.Message, "No account group specified");
                    return;
                }
            }

            string group = data.Message.Substring(start, end - start);
            var members = plugin.GetAccountMembers(group);

            StringBuilder msg = new StringBuilder("Members: ");
            for (int i = 0; i < members.Length; i++)
            {
                msg.Append(members[i]);
                if (i + 1 < members.Length)
                    msg.Append(", ");
            }

            plugin.Host.Reply(data, SendType.Message, msg.ToString());
        }
开发者ID:GGulati,项目名称:IRCBot,代码行数:33,代码来源:AccountGroupMembers.cs


示例3: Execute

        public override void Execute(IrcMessageData data)
        {
            int start = data.Message.IndexOf(Name, StringComparison.CurrentCultureIgnoreCase) + 2;
            if (data.Message.Length <= start)
            {
                plugin.Host.Reply(data, SendType.Message, "No such command");
                return;
            }

            int end = data.Message.IndexOf(' ');
            if (end <= start)
            {
                end = data.Message.Length;
                if (end <= start)
                {
                    plugin.Host.Reply(data, SendType.Message, "No such command");
                    return;
                }
            }

            string command = data.Message.Substring(start, end - start).ToLower();

            Type[] types = System.Reflection.Assembly.GetExecutingAssembly().GetTypes();
            //grab and add given command
        }
开发者ID:GGulati,项目名称:IRCBot,代码行数:25,代码来源:AddCommand.cs


示例4: AddPlayer

 private string AddPlayer(IrcMessageData msg)
 {
     string res;
     string sender = RealName(msg.From).ToLower();
     if (sender == "voodoohood")
     {
         if(msg.MessageArray.Length >= 2)
         {
             string userToAdd = msg.MessageArray[1].ToLower();
             bool playerAlreadyRegistered = _database.isUserRegistered(userToAdd);
             if (!playerAlreadyRegistered)
             {
                 _database.addPlayerToCraftWar(userToAdd);
                 res = "User " + userToAdd + " added to the registered players .";
                 DumberLogger.Log(" CraftWarComp: Added user" + userToAdd + " to database, is registered " + _database.isUserRegistered(userToAdd));
             }
             else
             {
                 res = "User " + userToAdd + " is already registered";
             }
               
         }
         else
         {
             res = null;
             DumberLogger.Log(" CraftWarComp: Format of the message wasnt correct");
         }
     }
     else
     {
         res = null;
         DumberLogger.Log(" CraftWarComp: User other than voodoohood tryed to add a user");
     }
     return res;
 }
开发者ID:HagenHeermann,项目名称:RalphInC-,代码行数:35,代码来源:CraftWarComp.cs


示例5: Execute

        public override void Execute(IrcMessageData data)
        {
            int start = data.Message.IndexOf(Name, StringComparison.CurrentCultureIgnoreCase) + Name.Length + 1;
            if (data.Message.Length <= start)
            {
                plugin.Host.Reply(data, SendType.Message, "No such command");
                return;
            }

            int end = data.Message.IndexOf(' ', start);
            if (end <= start)
            {
                end = data.Message.Length;
                if (end <= start)
                {
                    plugin.Host.Reply(data, SendType.Message, "No such command");
                    return;
                }
            }

            string group = data.Message.Substring(start, end - start);
            if (plugin.GetCommandsAtGroup(group) == null)
            {
                plugin.Host.Reply(data, SendType.Message, "No account group '" + group + "' exists");
                return;
            }

            plugin.RemoveAccountGroup(group);
            plugin.Host.Reply(data, SendType.Message, "Account group " + group + " deleted");
        }
开发者ID:GGulati,项目名称:IRCBot,代码行数:30,代码来源:AccountGroupDelete.cs


示例6: OnReadLine

        public bool OnReadLine(IrcMessageData data)
        {
            if ((data.Type != ReceiveType.ChannelMessage) && (data.Type != ReceiveType.QueryMessage))
                return true;

            if ((data.MessageArray.Length > 1) && ((data.MessageArray[0].ToLower() == "!nick") || (data.MessageArray[0].ToLower() == "!name"))) {
                _irc.RfcNick(data.MessageArray[1]);
                return true;
            }

            if ((data.Type == ReceiveType.ChannelMessage) && (data.MessageArray[0] == "!help")) {
                DisplayHelp(data);
                return true;
            }

            if (data.Type != ReceiveType.QueryMessage)
                return true;

            if (data.MessageArray.Length > 0) {
                _irc.SendMessage(SendType.Message, Admin._channel, data.Message);
                Console.WriteLine(data.Nick + " " + data.Message);
            }

            return true;
        }
开发者ID:silpheed,项目名称:IRC-Bot,代码行数:25,代码来源:Puppet.cs


示例7: Parse

 public static BanInfo Parse(IrcMessageData data)
 {
     BanInfo info = new BanInfo();
     // :magnet.oftc.net 367 meebey #smuxi [email protected] [email protected] 1216309801..
     info.f_Channel = data.RawMessageArray[3];
     info.f_Mask= data.RawMessageArray[4];
     return info;
 }
开发者ID:brudish,项目名称:furkiebot,代码行数:8,代码来源:BanInfo.cs


示例8: Check

 public override bool Check(IrcMessageData msg)
 {
     Boolean res = false;
     string com = msg.MessageArray[0];
     for (int i = 0; i < commands.Length; i++)
     {
         if (com == commands[i]) res = true;
     }
     return res;
 }
开发者ID:HagenHeermann,项目名称:RalphInC-,代码行数:10,代码来源:UtilComponent.cs


示例9: ParseForLink

 private void ParseForLink(IrcMessageData data)
 {
     CheckLinkDate();
     _links.AddRange(data.MessageArray.Where(word =>
         (!_links.Contains(word)) &&
         (Uri.IsWellFormedUriString(word, UriKind.Absolute)) &&
             ((word.StartsWith("http")) ||
             (word.StartsWith("www")))
         ));
 }
开发者ID:silpheed,项目名称:IRC-Bot,代码行数:10,代码来源:LOTD.cs


示例10: Disconnect

 private string Disconnect(IrcMessageData msg)
 {
     string sender = RealName(msg.From).ToLower();
     bool isSenderDev = sender == "voodoohood" || sender == "n1ghtsh0ck";
     if (isSenderDev)
     {
         Environment.Exit(0);
     }
     
     return null;
 }
开发者ID:HagenHeermann,项目名称:RalphInC-,代码行数:11,代码来源:UtilComponent.cs


示例11: CreateCtcpEventArgs

        protected IrcEventArgs CreateCtcpEventArgs(string aChannel, string aBot, string aMessage, ReceiveType aType, string aCtcpCommand)
        {
            IrcMessageData data = new IrcMessageData(null, "", aBot, "", "", aChannel, aMessage, aMessage, aType, ReplyCode.Null);
            CtcpEventArgs args = (CtcpEventArgs)System.Runtime.Serialization.FormatterServices.GetUninitializedObject(typeof(CtcpEventArgs));
            FieldInfo[] EventFields = typeof(IrcEventArgs).GetFields(BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly);
            EventFields[0].SetValue(args, data);

            FieldInfo[] EventFields2 = typeof(CtcpEventArgs).GetFields(BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly);
            EventFields2[0].SetValue(args, aCtcpCommand);

            return args;
        }
开发者ID:scottc,项目名称:xdcc-grabscher,代码行数:12,代码来源:AParser.cs


示例12: Execute

        public override void Execute(IrcMessageData data)
        {
            var groups = plugin.GetAccountGroups();
            StringBuilder msg = new StringBuilder("Existing groups: ");
            for (int i = 0; i < groups.Length; i++)
            {
                msg.Append(groups[i]);
                if (i + 1 < groups.Length)
                    msg.Append(", ");
            }

            plugin.Host.Reply(data, SendType.Message, msg.ToString());
        }
开发者ID:GGulati,项目名称:IRCBot,代码行数:13,代码来源:AccountGroupPrintAll.cs


示例13: Handle

        public override string Handle(IrcMessageData msg)
        {
            string res = null;
            string com = msg.MessageArray[0];
            switch (com)
            {
                case "#gamba":
                    res = Gamba(msg);
                    break;
            }
            return res;
            

        }
开发者ID:HagenHeermann,项目名称:RalphInC-,代码行数:14,代码来源:FunComponent.cs


示例14: Handle

 public override string Handle(IrcMessageData msg)
 {
     string res = null;
     string com = msg.MessageArray[0];
     switch (com)
     {
         case "#disconnect":
             Disconnect(msg);
             break;
         default:
             break;
     }
     return res;
 }
开发者ID:HagenHeermann,项目名称:RalphInC-,代码行数:14,代码来源:UtilComponent.cs


示例15: StartRoulette

 private string StartRoulette(IrcMessageData msg)
 {
     
     string res = null;
     string sender = RealName(msg.From).ToLower();
     if(sender == "voodoohood")
     {
         _rouletteActive = true;
         res = "Roulette started place your bets , you have 1 minute time. Use #placebet <0-36> <1-10000> to place a bet";
         Thread rouletteThread = new Thread(RouletteThreadTask);
         _bets = new List<bet>();
         rouletteThread.Start();
     }
     return res;
 }
开发者ID:HagenHeermann,项目名称:RalphInC-,代码行数:15,代码来源:TwitchCasinoComponent.cs


示例16: OnReadLine

        public bool OnReadLine(IrcMessageData data)
        {
            if ((data.Type != ReceiveType.ChannelMessage) || (_ignore.Contains(data.Nick)))
                return true;

            if ((data.MessageArray.Length > 0) && (data.MessageArray[0] == "!links"))
                DisplayLinks(data.Nick);

            if (data.MessageArray[0] == "!help")
                DisplayHelp(data);

            if ((data.MessageArray.Length > 0) && (data.Message.Trim().StartsWith("!")))
                return true;

            ParseForLink(data);

            return true;
        }
开发者ID:silpheed,项目名称:IRC-Bot,代码行数:18,代码来源:LOTD.cs


示例17: Handle

 public override string Handle(IrcMessageData msg)
 {
     string res;
     string com = msg.MessageArray[0];
     switch (com)
     {
         case "#startRoulette":
             res = StartRoulette(msg);
             break;
         case "#placebet":
             res = AddBet(msg);
             break;
         default:
             res = null;
             break;
     }
     return res;
 }
开发者ID:HagenHeermann,项目名称:RalphInC-,代码行数:18,代码来源:TwitchCasinoComponent.cs


示例18: OnReadLine

        public bool OnReadLine(IrcMessageData data)
        {
            if (data.Type != ReceiveType.ChannelMessage)
                return true;

            if ((data.MessageArray[0] == "!rainbow") || (data.MessageArray[0] == "!r"))
                Fabulise(data);

            if ((data.MessageArray[0] == "!doublerainbow") || (data.MessageArray[0] == "!dr")) {
                Fabulise(data);
                Fabulise(data);
            }

            if (data.MessageArray[0] == "!help")
                DisplayHelp(data);

            return true;
        }
开发者ID:silpheed,项目名称:IRC-Bot,代码行数:18,代码来源:Rainbow.cs


示例19: Execute

        public override void Execute(IrcMessageData data)
        {
            int start = data.Message.IndexOf(Name, StringComparison.CurrentCultureIgnoreCase) + Name.Length + 1;
            if (data.Message.Length <= start)
            {
                plugin.Host.Reply(data, SendType.Message, "No such command");
                return;
            }

            int end = data.Message.IndexOf(' ', start);
            if (end <= start)
            {
                end = data.Message.Length;
                if (end <= start)
                {
                    plugin.Host.Reply(data, SendType.Message, "No account specified");
                    return;
                }
            }

            string account = data.Message.Substring(start, end - start);

            start = end + 1;
            end = data.Message.IndexOf(' ', start);
            if (end <= start)
            {
                end = data.Message.Length;
                if (end <= start)
                {
                    plugin.Host.Reply(data, SendType.Message, "No account group specified");
                    return;
                }
            }

            string group = data.Message.Substring(start, end - start);
            if (plugin.GetCommandsAtGroup(group) == null)
            {
                plugin.Host.Reply(data, SendType.Message, "No account group named " + group);
                return;
            }

            plugin.AddAccount(account, group);
            plugin.Host.Reply(data, SendType.Message, string.Format("Account '{0}' successfully created", account, group));
        }
开发者ID:GGulati,项目名称:IRCBot,代码行数:44,代码来源:CreateAccount.cs


示例20: OnReadLine

        public bool OnReadLine(IrcMessageData data)
        {
            if (data.Type != ReceiveType.ChannelMessage)
                return true;

            if (data.MessageArray[0] == "!help")
                DisplayHelp(data);

            if (data.MessageArray.Length < 2)
                return true;

            if ((data.MessageArray[0] == "!big") || (data.MessageArray[0] == "!b"))
                Embiggen(data.Message.Split(null, 2)[1], false, data.Channel, data.Ident, data.Host);

            if ((data.MessageArray[0] == "!bigrainbow") || (data.MessageArray[0] == "!br"))
                Embiggen(data.Message.Split(null, 2)[1], true, data.Channel, data.Ident, data.Host);

            return true;
        }
开发者ID:silpheed,项目名称:IRC-Bot,代码行数:19,代码来源:Big.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Orders.Order类代码示例发布时间:2022-05-26
下一篇:
C# SmartIrc4net.IrcEventArgs类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap