|
|
@@ -216,6 +216,11 @@ def do_command(self, connection, event):
|
|
|
elif command.split()[1] == event.source.nick.lower():
|
|
|
connection.privmsg(replyto, "You already have your own coin. For help type " + blue + self.helpchar + "givecoin" + reset + ".")
|
|
|
return
|
|
|
+ elif len(command.split()) == 3:
|
|
|
+ if command.split()[2] < 0:
|
|
|
+ connection.privmsg(replyto, "You clever abuser! The " + red + self.cmdchar + bold + "give" + bold + "coin" + reset + " command is not designed for robbing. There will be consequences...")
|
|
|
+ self.db.run("UPDATE users SET coin=coin-3, karma_correction=karma_correction-0.5 WHERE name=%s", (event.source.nick))
|
|
|
+ return
|
|
|
elif not event.target == connection.get_nickname():
|
|
|
if not command.split()[1] in self.channels[event.target].users():
|
|
|
connection.privmsg(replyto, red + trigger.split()[1] + reset + " is not present.")
|
|
|
@@ -245,7 +250,7 @@ def do_command(self, connection, event):
|
|
|
self.db.run("UPDATE users SET coin=coin-1, coin_spent=coin_spent+1, coin_given=coin_given+1, ap_spent=ap_spent+1 WHERE name=%s AND network=%s", (event.source.nick, self.network, ))
|
|
|
self.db.run("UPDATE users SET coin=coin+1 WHERE LOWER(name)=%s AND network=%s", (command.split()[1], self.network, ))
|
|
|
elif len(command.split()) == 3:
|
|
|
- self.db.run("UPDATE users SET coin=coin-%s, coin_spent=coin_spent+%s, coin_given=coin_given+%s, ap_spent=ap_spent+%s WHERE name=%s AND network=%s", (command.split()[2], command.split()[2], command.split()[2], command.split()[2], event.source.nick, self.network, ))
|
|
|
+ self.db.run("UPDATE users SET coin=coin-%s, coin_spent=coin_spent+%s, coin_given=coin_given+%s, ap_spent=ap_spent+1 WHERE name=%s AND network=%s", (command.split()[2], command.split()[2], command.split()[2], event.source.nick, self.network, ))
|
|
|
self.db.run("UPDATE users SET coin=coin+%s WHERE LOWER(name)=%s AND network=%s", (command.split()[2], command.split()[1], self.network))
|
|
|
|
|
|
elif command.split()[0] == "players":
|