Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.53 KB | None | 0 0
  1. import JustIRC
  2. import random
  3.  
  4. bot = JustIRC.IRCConnection()
  5.  
  6. class Wallet:
  7.     def __init__(self, name, amount):
  8.         self.name = name
  9.         self.amount = amount
  10.  
  11. coinName = "ShitCoin"
  12.  
  13. userWallets = []
  14.  
  15. possibilities = [
  16.     "Points the gun at {} and pulls the trigger, CLICK!",
  17.     "Points the gun at {} and pulls the trigger, CLICK!",
  18.     "Points the gun at {} and pulls the trigger, CLICK!",
  19.     "Points the gun at {} and pulls the trigger, CLICK!",
  20.     "Points the gun at {} and pulls the trigger, CLICK!",
  21.     "Points the gun at {} and pulls the trigger, BOOM! you're dead"
  22. ]
  23.  
  24. def on_connect(bot):
  25.     bot.set_nick("bruddah")
  26.     bot.send_user_packet("bruddah")
  27.  
  28. def on_welcome(bot):
  29.     bot.join_channel("#gameroom")
  30.  
  31. def on_message(bot, channel, sender, message):
  32.     if ".rr" in message.lower():
  33.         return_message = random.choice(possibilities).format(sender)
  34.         bot.send_message(channel, return_message)
  35.  
  36.     if ".register" in message.lower():
  37.         data = Wallet("{}", 100)
  38.         userWallets.append(data)
  39.         bot.send_message(channel, "{} is now registered!")
  40.  
  41.     if ".balance" in message.lower():
  42.         for usr in userWallets:
  43.             if usr.nama == "{}":
  44.                 bot.send_message(channel, "{} your balance is: " + usr.amount)
  45.             else:
  46.                 bot.send_message(channel, "register firt ")
  47.  
  48. bot.on_connect.append(on_connect)
  49. bot.on_welcome.append(on_welcome)
  50. bot.on_public_message.append(on_message)
  51.  
  52. bot.connect("irc.freenode.net")
  53. bot.run_loop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement