tBKwtWS vor 6 Jahren
Ursprung
Commit
48debaab03
2 geänderte Dateien mit 5 neuen und 5 gelöschten Zeilen
  1. 4 4
      rotbot/commands/statistics.py
  2. 1 1
      rotbot/events/on_join.py

+ 4 - 4
rotbot/commands/statistics.py

@@ -41,9 +41,9 @@ def do_command(self, connection, event, user, channel):
                     connection.privmsg(replyto, '%sExample %s%s%s %s%s' % (font.grey, font.reset, self.network.command_character, one, self.network.home_channel))
             else:   # Actual command with no aruments.
                 if not channel:   # Command sent directly to bot
-                    connection.privmsg(replyto, '%sYour statistics:%s %suser/%s' % (font.grey, font.reset, self.webgui.base_url, user.slug))
+                    connection.privmsg(replyto, '%sYour statistics:%s %suser/%s' % (font.grey, font.reset, self.webgui['base_url'], user.slug))
                 else:   # Command sent to channel
-                    connection.privmsg(replyto, '%sChannel statistics:%s %channel/%s %sYour statistics:%s %suser/%s' % (font.grey, font.reset, self.webgui.base_url, channel.slug, font.grey, font.reset, self.webgui.base_url, user.slug))
+                    connection.privmsg(replyto, '%sChannel statistics:%s %schannel/%s %sYour statistics:%s %suser/%s' % (font.grey, font.reset, self.webgui['base_url'], channel.slug, font.grey, font.reset, self.webgui['base_url'], user.slug))
 
         elif len(command.split()) == 2:   # Command with one argument.
             if command.split()[1] in self.channels: # Argument matches a inhabited channel.
@@ -51,11 +51,11 @@ def do_command(self, connection, event, user, channel):
                     connection.privmsg(replyto, 'Send a link for statistics on channel: %s%s' % ( font.red, command.split()[1]))
                 else:   # Actual command with one argument
                     channel_slug = queries.get_channel_slug(self, command.split()[1])
-                    connection.privmsg(replyto, '%sStatistics on channel %s%s%s:%s %schannel/%s' % (font.grey, font.red, command.split()[1], font.grey, font.reset, self.webgui.base_url, channel_slug))
+                    connection.privmsg(replyto, '%sStatistics on channel %s%s%s:%s %schannel/%s' % (font.grey, font.red, command.split()[1], font.grey, font.reset, self.webgui['base_url'], channel_slug))
             else:   # Argument does not match a channel.
                 user_slug = queries.get_user_slug(self, command.split()[1])
                 if user:
-                    connection.privmsg(replyto, '%sStatistics on nickname %s%s%s:%s %s/user/$s' % (font.grey, font.red, command.split()[1], font.grey, font.reset, self.webgui.base_url, user_slug))
+                    connection.privmsg(replyto, '%sStatistics on nickname %s%s%s:%s %s/user/$s' % (font.grey, font.red, command.split()[1], font.grey, font.reset, self.webgui['base_url'], user_slug))
                 else:   # Argument does not match a channel or user.
                     connection.privmsg(replyto, 'I have not had the pleasure of being aquinted with: %s%s' % (font.red, command.split()[1]))
 

+ 1 - 1
rotbot/events/on_join.py

@@ -6,7 +6,7 @@ def process_event(self, connection, event):
     # Get and update resources.
     channel = queries.create_or_get_and_update_last_event(self, 'channel', 'cj', channel_name=event.target, user_name=event.source.nick)
     user = queries.create_or_get_and_update_last_event(self, 'user', 'cj', channel_name=event.target, user_name=event.source.nick)
-    queries.increment_join(self, channel, user)
+    queries.increment_join(self, channel.id, user.id)
 
     owners = queries.get_owners(self)
     if event.source in owners: