Closed impredicative closed 5 years ago
The irc
object can be used at any time, it's just passed to handlers for convenience and better scalability (and possibly irc.reply
in the future).
Yes. How do I get the irc
object in the first place though? I can then cache and reuse it, but how do I get it just once? This is independent of any other handlers I have, such as for PRIVMSG
.
Yes. How do I get the
irc
object in the first place though? I can then cache and reuse it, but how do I get it just once? This is independent of any other handlers I have.
miniirc.IRC
is a class and returns the irc
object:
irc = miniirc.IRC(...)
The way I've initialized miniirc.IRC
, it never returns. It serves forever. Here is an example.
You could possibly create a global irc
variable and set it from serve()
(or set self.irc
if you're going to use it inside the Bot
class).
Yes, but miniirc.IRC
never returns, so I can't set it.
On seconds thoughts, please disregard this issue altogether. I will obtain a handle to the irc
object when the channel is joined using a handler. I will then cache the object if I need to, or I can keep using it in that callback thread.
Yes, but
miniirc.IRC
never returns, so I can't set it.On seconds thoughts, please disregard this issue altogether. I will obtain a handle to the
irc
object when the channel is joined. I will then cache the object if I need to, or I can keep using it in that callback thread.
miniirc.IRC
returns after the TCP socket is initialised, the main loop is then run in a thread (that isn't marked as daemon
so the script doesn't exit).
Ah, that's right. Pardon my misunderstanding, and thank you so much.
I made a new bot (irc-rss-feed-bot) using miniirc.
@impredicative Do you mind if I add your bots to the working implementations list?
Please feel free to add.
Let's say I want to send a message to channel that is not in response to any IRC event or callback. How would I do this? It's easy for me to do when it is in response to a callback, as I am then supplied the
irc
object.How would I persistently and independently have a handle to the
irc
object which also remains usable despite any reconnections? I basically want to send some messages to a channel that are not in any response to any IRC events.I would rather not use a hacky workaround like using a calback for a
PING
.Thanks.