Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jun 10 20:03
    minkyman1 commented #198
  • Jun 10 18:45
    minkyman1 opened #198
  • Feb 20 02:15

    jaraco on main

    Ran pre-commit autoupdate Merge https://github.com/jaraco… ⚫ Fade to black. (compare)

  • Feb 20 02:09
    jaraco labeled #197
  • Feb 20 02:09

    jaraco on main

    Suppress DeprecationWarning unt… (compare)

  • Feb 20 02:02
    jaraco opened #197
  • Feb 20 01:53

    jaraco on main

    Use preferred 'fixture'. Fixes … (compare)

  • Feb 20 01:52

    jaraco on main

    Update badge year Remove setup.py, no longer need… Add exclusions for pytest 7 dep… and 5 more (compare)

  • Jan 01 23:44

    jaraco on v20.0.0

    (compare)

  • Jan 01 23:44

    jaraco on main

    Remove wheel from build require… Require Python 3.7 or later. Remove filtered warnings, addre… and 5 more (compare)

  • Dec 22 2021 04:18
    fitnub-bosbud synchronize #196
  • Oct 19 2021 21:57
    fitnub-bosbud synchronize #196
  • Oct 19 2021 21:56
    fitnub-bosbud commented #196
  • Oct 19 2021 21:55
    fitnub-bosbud commented #196
  • Oct 19 2021 21:54
    fitnub-bosbud synchronize #196
  • Oct 19 2021 15:36
    jaraco commented #194
  • Oct 19 2021 14:32
    jaraco commented #196
  • Oct 19 2021 14:17

    jaraco on v20.0.0

    (compare)

  • Oct 19 2021 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 2021 22:27
    fitnub-bosbud commented #196
TurBoss
@TurBoss
ok its working Thank you @jaraco
Jason R. Coombs
@jaraco
Glad it’s working. I’m not sure where it might be used other than in /me messages.
TurBoss
@TurBoss
will discover
ry00001
@ry00001
How do you get started with python irc?
everyone is afk
hah
TurBoss
@TurBoss
hi @ry00000
ry00001
@ry00001
hi @TurBoss
TurBoss
@TurBoss
this is a very basic bot I did
ry00001
@ry00001
oh god this is super complex
TurBoss
@TurBoss
it bridges my irc server to matrix.org (aka Riot)
what do you want to do?
ry00001
@ry00001
make an extremely basic bot
TurBoss
@TurBoss
sek
is not too big
only 200 lines
this is the bot section
ry00001
@ry00001
ok
TurBoss
@TurBoss
you can copypaste that code
then init the IrcBot class in your main
ry00001
@ry00001
can i get an ircbot without matrix integration
TurBoss
@TurBoss
sure
jus remove this:
to line 68
ry00001
@ry00001
Where's the example bot code
Jason R. Coombs
@jaraco
@ry00000 You might also look at testbot.py in the IRC project for a super basic example, or pmxbot for a more complex example, though if TurBoss’ ircbot gets you going then that’s fantastic.
ry00001
@ry00001
What's the example bot's prefix supposed to be?
: doesn't work
ry00001
@ry00001
@jaraco what's the example bot's prefix? I tried : but it didn't work
Jason R. Coombs
@jaraco
In test_bot, it looks like the prefix needs to be the bot nickname followed by a colon, so if the bot’s name is mybot, the prefix should be mybot:thecommand.
ry00001
@ry00001
ah
Jason R. Coombs
@jaraco
Each incoming message is handled in on_pubmsg, so you can adapt that to whatever behavior you want.
ry00001
@ry00001
Oh
but on_command is the main cmd loop
Jason R. Coombs
@jaraco
I’m not following. on_command does not appear in the testbot.py script (nor the irc library), so you’re probably getting that from elsewhere.
ry00001
@ry00001
er, no, do_command
sorry
Jason R. Coombs
@jaraco
Oh, right. Well on_pubmsg parses the incoming messages, and detects if there’s a command (as above) and if so, dispatches that using do_command.
ry00001
@ry00001
how do i turn pylint off
it's getting annoying
how do I get arguments from a command?
say i have kick <user> <channel>
how do i get user and channel
Jason R. Coombs
@jaraco
@ry00000: Not sure about pylint. Depends on your editor/environment. I don’t think IRC uses pylint itself.
As for getting arguments from a command, I’m not sure what you’re after. Are you trying as the client (bot) to kick another user from a channel? For that, there’s a kick method on the ServerConnection (https://github.com/jaraco/irc/blob/master/irc/client.py#L803).
Jason R. Coombs
@jaraco
Or if you’re looking to respond to an event where your bot has been kicked, you probably need to define an on_kick method and it accepts a connection and event argument, with more details in the event that the server supplied. I’m not sure the protocol works that way, but if the server issues a KICK command, you would handle that with on_kick in the client.