mirror of
https://github.com/jlu5/PyLink.git
synced 2025-01-26 04:04:22 +01:00
docs: bring plugin_example.py up to date
This commit is contained in:
parent
9e73af050c
commit
32556d418d
@ -26,7 +26,7 @@ def hook_privmsg(irc, source, command, args):
|
|||||||
# irc.pseudoclient stores the IrcUser object of the main PyLink client.
|
# irc.pseudoclient stores the IrcUser object of the main PyLink client.
|
||||||
# (i.e. the user defined in the bot: section of the config)
|
# (i.e. the user defined in the bot: section of the config)
|
||||||
if utils.isChannel(channel) and irc.pseudoclient.nick in text:
|
if utils.isChannel(channel) and irc.pseudoclient.nick in text:
|
||||||
utils.msg(irc, channel, 'hi there!')
|
irc.msg(channel, 'hi there!')
|
||||||
log.info('%s said my name on channel %s (PRIVMSG hook caught)' % (source, channel))
|
log.info('%s said my name on channel %s (PRIVMSG hook caught)' % (source, channel))
|
||||||
utils.add_hook(hook_privmsg, 'PRIVMSG')
|
utils.add_hook(hook_privmsg, 'PRIVMSG')
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ def randint(irc, source, args):
|
|||||||
except IndexError:
|
except IndexError:
|
||||||
rmin, rmax = 1, 10
|
rmin, rmax = 1, 10
|
||||||
n = random.randint(rmin, rmax)
|
n = random.randint(rmin, rmax)
|
||||||
utils.msg(irc, source, str(n))
|
irc.msg(source, str(n))
|
||||||
# You can also bind a command function multiple times, and/or to different command names via a
|
# You can also bind a command function multiple times, and/or to different command names via a
|
||||||
# second argument.
|
# second argument.
|
||||||
# Note: no checking is done at the moment to prevent multiple plugins from binding to the same
|
# Note: no checking is done at the moment to prevent multiple plugins from binding to the same
|
||||||
|
Loading…
Reference in New Issue
Block a user