Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 19 21:57
    fitnub-bosbud synchronize #196
  • Oct 19 21:56
    fitnub-bosbud commented #196
  • Oct 19 21:55
    fitnub-bosbud commented #196
  • Oct 19 21:54
    fitnub-bosbud synchronize #196
  • Oct 19 15:36
    jaraco commented #194
  • Oct 19 14:32
    jaraco commented #196
  • Oct 19 14:17

    jaraco on v20.0.0

    (compare)

  • Oct 19 14:17

    jaraco on main

    Implement tidelift banner using… Remove blacken docs as it canno… .editorconfig: Set max_line_len… and 8 more (compare)

  • Oct 18 22:27
    fitnub-bosbud commented #196
  • Oct 13 01:19
    fitnub-bosbud commented #196
  • Oct 13 01:19
    fitnub-bosbud commented #196
  • Oct 13 00:52
    jaraco commented #196
  • Oct 13 00:46
    jaraco labeled #193
  • Oct 13 00:46
    jaraco commented #193
  • Oct 12 22:27
    fitnub-bosbud opened #196
  • Sep 13 12:47

    jaraco on main

    Added support for NOTICE comman… Merge branch 'jaraco:main' into… Use correct method... and 3 more (compare)

  • Sep 13 12:47
    jaraco closed #192
  • Sep 13 02:32
    jheddings commented #192
  • Sep 12 22:53
    jheddings synchronize #192
  • Sep 12 22:47
    jheddings synchronize #192
Jason R. Coombs
@jaraco
@de-odex : Yes, essentially. Here’s where it’s done in pmxbot: https://github.com/yougov/pmxbot/blob/master/pmxbot/irc.py#L63
You can either define a custom bot class or pass in the list of servers to the bot class naturally.
Justin Kyle Ramos
@de-odex
what unit of time does execute_after use?
Justin Kyle Ramos
@de-odex
actually i cant even figure out how to use the scheduler
Jason R. Coombs
@jaraco
@de-odex It uses a datetime.timedelta or integer seconds.
(IIRC)
Justin Kyle Ramos
@de-odex
okay thanks
Jason R. Coombs
@jaraco
(the scheduler does)
Justin Kyle Ramos
@de-odex
is there a way to simulate a privmsg within python (maybe using the module)? for pytest
Justin Kyle Ramos
@de-odex
oh, also, does message sending also have a rate limit? can it be set?
Jason R. Coombs
@jaraco
@de-odex The pmxbot project sets up a full integration test, creating a server and client to test the interaction. https://github.com/yougov/pmxbot/blob/95c30bf82511174cb971b8f31fe5592a57b58a65/tests/functional/__init__.py#L38
It’s rather complicated, and there may be simpler approaches, but that’s the one with which I’m most familiar.
Justin Kyle Ramos
@de-odex
thanks again ;w;
Justin Kyle Ramos
@de-odex
more questions: how do i receive the output of a WHOIS?
also can set_rate_limit, rather than block, queue messages?
Justin Kyle Ramos
@de-odex
nevermind, seems like set_rate_limit queues messages, block implies the message is lost if it exceeds the rate limit
Jason R. Coombs
@jaraco
I’m not sure what it means to receive the output of a WHOIS. I think you mean for the client to issue a whois command and then respond when the result comes back. I think for that, all you need to do is define a handler for the response. I’m not sure how that response comes back, but it may be you just need to define an on_whois method in your client class.
Justin Kyle Ramos
@de-odex
image.png
how do i get this via your lib?
is it e.source?
nvm, thanks, it's e.source.userhost
Jason R. Coombs
@jaraco
Awesome. Glad you found it.
依云
@lilydjwg
I'm lost. Where is the doc for events?
Jason R. Coombs
@jaraco
Sorry, @lilydiwg - there’s no documentation other than the code and its docs. Best I can tell, an “event” is a concept internal to the IRC library and the IRC protocol, defined by https://tools.ietf.org/html/rfc1459 and others, speaks mostly of commands and messages.
MineRobber___T
@MineRobber9000
Hi, I was wondering how to get a userhost given a nick? I'm implementing a blocklist for my bot and I want to be able to block someone by their userhost (block by nick and they can change it, changing user requires thought and a relog)
Jason R. Coombs
@jaraco
@MineRobber9000 Looks like you can do client.userhost([nick]) to request the userhost and then define on_userhost in your client to handle the response.
(I haven’t tried this myself)
Jan-Philipp
@Fittiboy
I was about to ask a question on how to handle the events specified here https://dev.twitch.tv/docs/irc/tags#usernotice-twitch-tags using this module. However I have just found out how to do it myself (very proud as this is the first time I'm actually reading another person's code :). Trying to get this to work took me quite a while, so here is a different question instead: I want to make a tutorial for others on how to make a bot that handles these events, using this module. Where do you think is the best place for it, where the people that want to look for it will actually find it? I'm still fairly new to coding so I don't yet know where people look for coding tutorials. Is it YouTube?
Also, if anyone wants to know how to handle those twitch events, you can ask me here of course!
scoopgracie
@scoopgracie
Umm... this is an IRC library. Why is the chat room on Gitter?
Jason R. Coombs
@jaraco
@Fittiboy Thanks for asking, and sorry for the delay. Glad to hear you got it working. From the perspective of the IRC library, there are two main places where it is documented - in the readme and in the docs at https://python-irc.readthedocs.io/en/latest/. Both of those are managed through the github project, so if you want to contribute a PR to the docs there, it would be more than welcome. If you have questions about doing it, file an issue describing what problem you’re trying to solve and ask questions for help there (or here, but I’ll likely find this later).
@scoopgracie Gitter/Slack are way better than IRC in terms of features, apps, integrations. It cost nothing to support the project here and I can get push notifications and similar on my devices. I’d be open to having a channel in IRC.
grateful
@jonosur_gitlab
Do you have further documentation on the use of irc.server? specifically related to linking to an ircd. I'm looking to create a small irc service using python
Jason R. Coombs
@jaraco
@jonosur_gitlab I don’t. The best I can recommend is to read the code and infer the usage… If you want to add functionality, I’m open to contributions.
Clay M.
@afiaka87
Hi there. This channel dead?
Trying to modify the irccat example to just simply run a method every 10 seconds.
It checks twitch to see if i'm streaming or not. If I am it posts a message in the chat, if not it does nothing
Having trouble with the scheduling though
Jason R. Coombs
@jaraco
The channel isn’t dead.
The irc package includes rudimentary scheduling support.
Jason R. Coombs
@jaraco
What have you tried? Did you know there’s reactor.scheduler.execute_every(period=10, func=check_streaming)
qedk
@QEDK
any idea why this would happen? https://pastebin.com/7mV10qyD
seems like an upstream issue as far as I can tell
Jason R. Coombs
@jaraco
@QEDK I see you’re using the AioReactor. I suspect that class doesn’t have a scheduler. I’m not super familiar with that implementation of a reactor, so it may be that scheduling isn’t supported on AsyncIO yet.
I welcome you to investigate and devise a solution.
You might also reach out to those who contributed the Async behavior.
As they may have an opinion or advice.
hifi
@hifi:vi.fi
[m]
a bit quiet in here