|
@@ -217,10 +217,13 @@ def do_command(self, connection, event):
|
|
|
connection.privmsg(replyto, "You already have your own coin. For help type " + blue + self.helpchar + "givecoin" + reset + ".")
|
|
connection.privmsg(replyto, "You already have your own coin. For help type " + blue + self.helpchar + "givecoin" + reset + ".")
|
|
|
return
|
|
return
|
|
|
elif len(command.split()) == 3:
|
|
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
|
|
|
|
|
|
|
+ try:
|
|
|
|
|
+ if str(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
|
|
|
|
|
+ except TypeError:
|
|
|
|
|
+ connection.privmsg(replyto, "Invalid amount. For help type " + blue + self.helpchar + "givecoin" + reset + ".")
|
|
|
elif not event.target == connection.get_nickname():
|
|
elif not event.target == connection.get_nickname():
|
|
|
if not command.split()[1] in self.channels[event.target].users():
|
|
if not command.split()[1] in self.channels[event.target].users():
|
|
|
connection.privmsg(replyto, red + trigger.split()[1] + reset + " is not present.")
|
|
connection.privmsg(replyto, red + trigger.split()[1] + reset + " is not present.")
|