Skip to content

Commit

Permalink
add user to items sent to plugins (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
archangelic authored Oct 17, 2024
1 parent 7a118fd commit 5ca78c9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pinhook/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.10.0'
__version__ = '1.10.1'
9 changes: 7 additions & 2 deletions pinhook/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,13 @@ def __init__(self, channels, nickname, server, **kwargs):
plugin.load_plugins(self.plugin_dir, use_prefix=self.use_prefix_for_plugins, cmd_prefix=self.cmd_prefix)

class Message:
def __init__(self, bot, channel, nick, botnick, ops, logger, action, privmsg, notice, msg_type, cmd=None, arg=None, text=None, nick_list=None):
def __init__(self, bot, channel, nick, user, botnick, ops, logger, action, privmsg, notice, msg_type, cmd=None, arg=None, text=None, nick_list=None):
self.bot = bot
self.datetime = datetime.now(timezone.utc)
self.timestamp = self.datetime.timestamp()
self.channel = channel
self.nick = nick
self.user = user
self.nick_list = nick_list
self.botnick = botnick
self.ops = ops
Expand Down Expand Up @@ -192,7 +193,7 @@ def call_internal_commands(self, channel, nick, cmd, text, arg, c):
output = plugin.message('currently banned: {}'.format(', '.join(self.banned_users)))
return output

def call_plugins(self, privmsg, action, notice, chan, cmd, text, nick_list, nick, arg, msg_type):
def call_plugins(self, privmsg, action, notice, chan, cmd, text, nick_list, nick, user, arg, msg_type):
output = None
if cmd in plugin.cmds:
try:
Expand All @@ -207,6 +208,7 @@ def call_plugins(self, privmsg, action, notice, chan, cmd, text, nick_list, nick
cmd=cmd,
nick_list=nick_list,
nick=nick,
user=user,
arg=arg,
privmsg=privmsg,
action=action,
Expand All @@ -229,6 +231,7 @@ def call_plugins(self, privmsg, action, notice, chan, cmd, text, nick_list, nick
text=text,
nick_list=nick_list,
nick=nick,
user=user,
privmsg=privmsg,
action=action,
notice=notice,
Expand All @@ -247,6 +250,7 @@ def call_plugins(self, privmsg, action, notice, chan, cmd, text, nick_list, nick

def process_event(self, c, e):
nick = e.source.nick
user = e.source.user
if nick == self.bot_nick:
pass
if e.arguments:
Expand Down Expand Up @@ -282,6 +286,7 @@ def process_event(self, c, e):
'text': text,
'nick_list': nick_list,
'nick': nick,
'user': user,
'arg': arg,
'privmsg': c.privmsg,
'action': c.action,
Expand Down

0 comments on commit 5ca78c9

Please sign in to comment.