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

C# IrcDotNet.IrcClient类代码示例

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

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



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

示例1: handleURL

        public bool handleURL(string url, IrcClient ctx, CtcpClient ctpcclient = null, IIrcMessageSource source = null )
        {
            var title = GetPageTitle(url).Trim();
            if (!string.IsNullOrWhiteSpace(title))
            {
                if(title.ToLower().Contains("Domainpark - Bitte den Rasen nicht betreten".ToLower()))
                {
                    int roll = random.Next(0, 101);
                    if(roll < 5)
                    {
                        if(ctpcclient != null)
                        {
                            string textMessage = "slaps " + source.Name + " and screamed:";
                            BotDeathmicMessageTarget target = new BotDeathmicMessageTarget();
                            target.Name = Properties.Settings.Default.Channel.ToString();
                            ctpcclient.SendAction(target, textMessage);
                            ctx.LocalUser.SendMessage(Properties.Settings.Default.Channel, "Runter vom Rasen!");
                        }
                    }
                }
                else
                {
                    if(title.ToLower() == "Imgur: The most awesome images on the Internet".ToLower())
                    {

                    }
                    else
                    {
                        ctx.LocalUser.SendMessage(Properties.Settings.Default.Channel, title);
                    }

                }
            }
            return true;
        }
开发者ID:Kolpa,项目名称:DeathmicChatbot,代码行数:35,代码来源:WebSiteHandler.cs


示例2: SayInChannels

 public static void SayInChannels(IrcClient client, string msg)
 {
     foreach (var channel in client.Channels)
     {
         client.LocalUser.SendMessage(channel, msg);
     }
 }
开发者ID:djeebus,项目名称:MusicHub,代码行数:7,代码来源:IrcHelper.cs


示例3: Execute

        public void Execute(IrcClient Client, string channel, IrcUser Sender, string message)
        {
            message = message.Trim();
            if (message == "")
            {
                Client.LocalUser.SendMessage(channel, horoscopeHelpMsg());
            }
            else
            {

                if (!signs.ContainsKey(message))
                {
                    Client.LocalUser.SendMessage(channel, "Why won't you give me a sign~");
                    return;
                }

                string html = getHTML(signs[message]);

                string horoscope = dropHtmlPrecedingHoroscope(html, message);
                horoscope = dropHtmlTailingHoroscope(horoscope);
                horoscope = html2Txt(horoscope);

                Client.LocalUser.SendMessage(channel, horoscope);
            }
        }
开发者ID:code-n-beer,项目名称:SimoBot,代码行数:25,代码来源:HoroscopeFeature.cs


示例4: HandleEventLoop

        private static void HandleEventLoop(IrcClient client)
        {
            _ircLocaluser = client.LocalUser;
              _hostNameToWebSockets.Add("", new WebSocketListenerClient(PrivateConstants.TestAccountWebsocketAuth));
              _hostNameToWebSockets[""].Run(sendToIrcProcessor);

              bool isExit = false;
              while (!isExit) {
            Console.Write("> ");
            var command = Console.ReadLine();
            switch (command) {
              case "exit":
            isExit = true;
            break;
              default:
            if (!string.IsNullOrEmpty(command)) {
              if (command.StartsWith("/") && command.Length > 1) {
                client.SendRawMessage(command.Substring(1));
              } else {
                Console.WriteLine($"Unknown command '{command}'");
              }
            }
            break;
            }
              }
              client.Disconnect();
        }
开发者ID:destinygg,项目名称:bot,代码行数:27,代码来源:Program.cs


示例5: ChannelSearchViewModel

 public ChannelSearchViewModel(IrcClient client)
 {
     this.client = client;
       this.allChannels = new List<BindableChannelInfo>();
       this.Channels = new BindableCollection<BindableChannelInfo>();
       this.client.ChannelListReceived += ircClient_ChannelListReceived;
       this.DisplayName = "Join Channel";
 }
开发者ID:schwarz,项目名称:handle,代码行数:8,代码来源:ChannelSearchViewModel.cs


示例6: InvalidSyncLibraryCommand

 protected void InvalidSyncLibraryCommand(
     IrcClient client, 
     IList<IIrcMessageTarget> replyTarget, 
     string commandError)
 {
     client.LocalUser.SendMessage(replyTarget, string.Format("Invalid .sync-command: {0}", commandError));
     client.LocalUser.SendMessage(replyTarget, "Usage: .sync-library library-guid");
 }
开发者ID:djeebus,项目名称:MusicHub,代码行数:8,代码来源:BaseCommand.cs


示例7: Start

        /// <summary>
        /// 
        /// </summary>
        /// <param name="twitchUsername"></param>
        /// <param name="twitchOAuthToken">
        /// A chat login token which can be generated here: http://www.twitchapps.com/tmi/
        /// </param>
        public void Start(string twitchUsername, string twitchOAuthToken)
        {
            var client = new IrcClient();

            client.Connected += client_Connected;
            client.ChannelListReceived += client_ChannelListReceived;
            client.RawMessageReceived += client_RawMessageReceived;

            client.Connect("irc.twitch.tv", 6667, false, new IrcUserRegistrationInfo() {NickName = twitchUsername, Password = twitchOAuthToken, UserName = twitchUsername, RealName = twitchUsername});
        }
开发者ID:GrimPanda,项目名称:x-plays-gameboy,代码行数:17,代码来源:TwitchChatEngine.cs


示例8: Client

        public Client(Server server)
        {
            client = new IrcClient();
            this.server = server;

            channels = getChannels(server);

            SetEventHandlers();
            findClientConfs();
        }
开发者ID:code-n-beer,项目名称:SimoBot,代码行数:10,代码来源:Client.cs


示例9: Irc

        public ActionResult Irc()
        {
            var api = new AppHarborApi(new AuthInfo { AccessToken = ConfigurationManager.AppSettings["authToken"] });

            var latestBuild = api.GetBuilds(Constants.AppHarborAppName).First();
            var testResults = api.GetTests(Constants.AppHarborAppName, latestBuild.ID);
            List<AppHarbor.Model.Test> allTests = new List<AppHarbor.Model.Test>();

            foreach (var testresult in testResults)
            {
                FillTests(allTests, testresult);
            }

            AutoResetEvent are = new AutoResetEvent(false);
            IrcDotNet.IrcClient client = new IrcDotNet.IrcClient();

            try
            {
                client.Connect("irc.gamesurge.net", false, new IrcUserRegistrationInfo() { NickName = "crymono-build", RealName = "crymono", UserName = "crymono" });

                client.ClientInfoReceived += (s, e) => are.Set();

                are.WaitOne();

                client.Channels.Join(new string[] { "#crymono" });

                Thread.Sleep(200);
                string msg = latestBuild.Commit.Message.Replace("\n", "").Replace("\r", "");

                client.LocalUser.SendMessage("#crymono", "Build finished, latest commit: " + msg);
                Thread.Sleep(200);

                int numPassedTests = allTests.Count(t => t.Status == "Passed");
                float percentage = (float)numPassedTests / allTests.Count * 100;
                client.LocalUser.SendMessage("#crymono", String.Format("Test results: {0} of {1} passed ({2:0}%) - http://crymono.apphb.com/#!/{3} - AppHB: https://appharbor.com/applications/crymonobuild/builds/{3}/tests",
                    numPassedTests,
                    allTests.Count,
                    percentage,
                    latestBuild.ID
                    ));
                Thread.Sleep(200);

            }
            finally
            {
                if (client != null && client.IsConnected)
                {
                    client.Quit("to the hills!");
                    Thread.Sleep(200);
                    client.Disconnect();
                }
            }

            return Content("OK");
        }
开发者ID:PoppermostProductions,项目名称:CryMono-web,代码行数:55,代码来源:NotifyController.cs


示例10: IrcMessageCommand

 public IrcMessageCommand(
     IrcBot bot, 
     IrcBotUser user,
     IrcClient client, 
     string[] parameters, 
     IIrcMessageTarget target, 
     IIrcMessageSource source
 )
     : base(bot, user, client, parameters, target, source)
 {
 }
开发者ID:koushikajay,项目名称:Alfred,代码行数:11,代码来源:IrcMessageCommand.cs


示例11: IrcQueryViewModel

 public IrcQueryViewModel(IrcUser user, IrcClient client, Settings settings)
 {
     this.Settings = settings;
       this.User = user;
       this.client = client;
       this.DisplayName = user.NickName;
       this.Messages = new BindableCollection<Message>();
       this.Closable = true;
       // TODO
       this.client.LocalUser.MessageReceived += this.messageReceived;
 }
开发者ID:schwarz,项目名称:handle,代码行数:11,代码来源:IrcQueryViewModel.cs


示例12: IrcStatusTabViewModel

        /// <summary>
        /// Initializes a new instance of the IrcChannelViewModel class
        /// </summary>
        public IrcStatusTabViewModel(IrcClient client)
        {
            this.Messages = new BindableCollection<Message>();
              this.Closable = false;
              this.DisplayName = "Status";
              this.Client = client;

              this.Client.LocalUser.MessageReceived += this.localUserMessageReceived;
              this.Client.MotdReceived += this.clientMessageOfTheDayReceived;
              this.Client.WhoIsReplyReceived += this.clientWhoIsReplyReceived;
        }
开发者ID:schwarz,项目名称:handle,代码行数:14,代码来源:IrcStatusTabViewModel.cs


示例13: ProcessChatCommandHelp

        private void ProcessChatCommandHelp(IrcClient client, IIrcMessageSource source,
            IList<IIrcMessageTarget> targets, string command, IList<string> parameters)
        {
            if (parameters.Count != 0)
                throw new InvalidCommandParametersException(0);

            // List all commands recognized by this bot.
            var replyTarget = GetDefaultReplyTarget(client, source, targets);
            client.LocalUser.SendMessage(replyTarget, "Commands recognized by bot:");
            client.LocalUser.SendMessage(replyTarget, string.Join(", ",
                this.ChatCommandProcessors.Select(kvPair => kvPair.Key)));
        }
开发者ID:gkinsman,项目名称:StatsBot,代码行数:12,代码来源:BasicIrcBot.cs


示例14: IrcBot

        public IrcBot(IrcBotConfiguration configuration)
        {
            this.tasks = new List<IIrcTask>();
            this.users = new ConcurrentDictionary<string, IrcBotUser>();

            configuration.UserName = configuration.UserName ?? configuration.NickName;
            configuration.RealName = configuration.RealName?? configuration.NickName;

            this.Configuration = configuration;

            this.commandPrefix = string.Format("{0}", this.Configuration.NickName.ToLower());

            this.client = new IrcClient();
        }
开发者ID:koushikajay,项目名称:Alfred,代码行数:14,代码来源:IrcBot.cs


示例15: ConnectAndSetup

 public void ConnectAndSetup()
 {
     _client = new IrcClient();
     _client.Connect("irc.homelien.no", 6667, false, new IrcUserRegistrationInfo
         {
             NickName = "testL",
             UserName = "testLK",
             RealName = "LarsBot"
         });
     _client.Connected += ClientOnConnected;
     _client.Disconnected += _client_Disconnected;
     _client.RawMessageReceived += _client_RawMessageReceived;
     _client.Error += ClientOnError;
     _client.ErrorMessageReceived += ClientOnErrorMessageReceived;
 }
开发者ID:bremnes,项目名称:IrcBot,代码行数:15,代码来源:RawIrcBot.cs


示例16: SpeedRunsLiveIRC

 public SpeedRunsLiveIRC(LiveSplitState state, ITimerModel model, IEnumerable<string> channels)
 {
     ChannelsToJoin = channels.ToList();
     Client = new IrcClient();
     Client.ConnectFailed += Client_ConnectFailed;
     Client.Connected += Client_Connected;
     Client.Registered += Client_Registered;
     Client.RawMessageReceived += Client_RawMessageReceived;
     Client.ConnectFailed += Client_ConnectFailed;
     Client.Disconnected += Client_Disconnected;
     Model = model;
     state.OnSplit += Model_OnSplit;
     state.OnUndoSplit += Model_OnUndoSplit;
     state.OnReset += Model_OnReset;
     RaceState = RaceState.NotInRace;
 }
开发者ID:0xwas,项目名称:LiveSplit,代码行数:16,代码来源:SpeedRunsLiveIRC.cs


示例17: Run

        public void Run(IrcClient client, IIrcMessageSource source, IList<IIrcMessageTarget> targets, string command, IList<string> parameters)
        {
            Client = client;
            SourceUser = (IrcUser)source;
            Command = command;
            Parameters = parameters;

            if (targets.Contains(Client.LocalUser) && source != null)
                ReplyTargets = new[] { (IIrcMessageTarget)source };
            else
            {
                ReplyTargets = targets;
            }

            Run();
        }
开发者ID:bremnes,项目名称:IrcBot,代码行数:16,代码来源:BaseChatCommand.cs


示例18: Connect

        public INetwork Connect(INetwork network, IUser user)
        {
            IrcClient ircClient = new IrcClient();
            INetwork connection = this.RegisterNetwork(ircClient, network);

            this.OnNetworkAdded(connection);

            ircClient.Connect(network.Url.Host, network.Url.Port, false, new IrcUserRegistrationInfo()
            {
                NickName = user.Nickname,
                RealName = user.Realname,
                UserName = user.Nickname,
            });

            return network;
        }
开发者ID:SilentPenguin,项目名称:Skyscraper,代码行数:16,代码来源:ConnectionManager.cs


示例19: TwitchChat

        public TwitchChat(string accessToken, string channel)
        {
            Client = new IrcClient();
            UserFlags = new Dictionary<string, ChatBadges>();
            UserColors = new Dictionary<string, Color>();
            var twitch = Twitch.Instance;
            Client.Connected += Client_Connected;
            Client.Registered += Client_Registered;
            Channel = channel;

            Client.Connect("irc.twitch.tv", 6667,
                new IrcUserRegistrationInfo()
                {
                    NickName = twitch.ChannelName,
                    Password = $"oauth:{accessToken}"
                });
        }
开发者ID:Rezura,项目名称:LiveSplit,代码行数:17,代码来源:TwitchChat.cs


示例20: IrcCommand

        public IrcCommand(
            IrcBot bot, 
            IrcBotUser user,
            IrcClient client, 
            string[] parameters, 
            IIrcMessageTarget target, 
            IIrcMessageSource source
        )
        {
            this.Bot = bot;
            this.User = user;
            this.Client = client;
            this.Target = target;
            this.Source = source;

            ParseParameters(parameters);
        }
开发者ID:koushikajay,项目名称:Alfred,代码行数:17,代码来源:IrcCommand.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# IrcDotNet.IrcLocalUser类代码示例发布时间:2022-05-26
下一篇:
C# IrcDotNet.IrcChannel类代码示例发布时间: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