irc

How do I correctly shutdown a Bot::BasicBot bot (based on POE::Component::IRC)?

南笙酒味 提交于 2019-12-02 00:30:50
问题 This is a sample script. When I hit Ctrl+C, the bot quits IRC but it reconnects back after some time. How do I shut down the bot correctly? #!/usr/bin/perl package main; my $bot = Perlbot->new (server => 'irc.dal.net'); $SIG{'INT'} = 'Handler'; $SIG{'TERM'} = 'Handler'; sub Handler { print "\nShutting down bot...\n"; $bot->shutdown('Killed.'); }; $bot->run; package Perlbot; use base qw(Bot::BasicBot); sub connected { my $self = shift; $self->join('#codetestchan'); } 回答1: I've taken over

Python IRC bot question

依然范特西╮ 提交于 2019-12-01 13:48:26
I want to make a bot that will allow me to define functions from irc and treat my bot like a Python interpreter too. For example, I want to make a bot that can do something like the following: <mynick> py print "test" <bot> test <mynick> define hi(): print "hi" <mynick> hi() <bot> hi MY QUESTION IS HOW TO DO THIS If you're not worried about security (and if this is a personal project then that's a valid assumption), then Python has several functions ( compile , exec , eval ) that can help here. Note that there are differences between Python 2 and Python 3, but the following example works for

Python IRC bot question

六眼飞鱼酱① 提交于 2019-12-01 12:37:32
问题 I want to make a bot that will allow me to define functions from irc and treat my bot like a Python interpreter too. For example, I want to make a bot that can do something like the following: <mynick> py print "test" <bot> test <mynick> define hi(): print "hi" <mynick> hi() <bot> hi MY QUESTION IS HOW TO DO THIS 回答1: If you're not worried about security (and if this is a personal project then that's a valid assumption), then Python has several functions ( compile , exec , eval ) that can

Sending data received in one Twisted factory to second factory

假如想象 提交于 2019-11-30 09:59:59
I am trying to write a simple program using Twisted framework and I am struggling with resolving (or even with imaging how to write it) issue I couldnt find any relevant documentation for: The main reactor uses two factories, one custom, listening for TCP connections on given port (say, 8000) and second one, to log into given IRC server and channel. On receiving data (simple, one line text) on the factory listening at 8000, I need to pass that data to second factory, so it could be then processed accordingly - either send a message with that text to a channel, or a priv message to some person,

IRC library in C# [closed]

坚强是说给别人听的谎言 提交于 2019-11-29 23:17:58
I want to embed a small chat window in my program that will function as a basic IRC client. This requires limited functionality such as connecting, disconnecting, listing users, and sending private messages. As of writing, I have tried several bloated libraries that make it too difficult to create a simple application (wiring many events, handling things like channels, modes, etc. that I'm not interested in). Other libraries I've tried are developed for old versions of .NET and are full of deprecation warnings. How can I develop a lightweight IRC client in C#? Two years later, now there's

Sending data received in one Twisted factory to second factory

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-29 15:38:27
问题 I am trying to write a simple program using Twisted framework and I am struggling with resolving (or even with imaging how to write it) issue I couldnt find any relevant documentation for: The main reactor uses two factories, one custom, listening for TCP connections on given port (say, 8000) and second one, to log into given IRC server and channel. On receiving data (simple, one line text) on the factory listening at 8000, I need to pass that data to second factory, so it could be then

IRC library in C# [closed]

半城伤御伤魂 提交于 2019-11-28 20:35:51
问题 I want to embed a small chat window in my program that will function as a basic IRC client. This requires limited functionality such as connecting, disconnecting, listing users, and sending private messages. As of writing, I have tried several bloated libraries that make it too difficult to create a simple application (wiring many events, handling things like channels, modes, etc. that I'm not interested in). Other libraries I've tried are developed for old versions of .NET and are full of

IRC Python Bot: Best Way [closed]

孤人 提交于 2019-11-28 18:02:00
I want to build a bot that basically does the following: Listens to the room and interacts with users and encourages them to PM the bot. Once a user has PMed the bot engage with the client using various AI techniques. Should I just use the IRC library or Sockets in python or do I need more of a bot framework. What would you do? Thanks! Here is the code I'm currently using, however, I haven't gotten it to work. #!/usr/bin/python import socket network = 'holmes.freenet.net' port = 6667 irc = socket.socket ( socket.AF_INET, socket.SOCK_STREAM ) irc.connect ( ( network, port ) ) irc.send ( 'NICK