def main(): while True: print('=' * 30) print('Select - \n1. User Login\n2. Admin Login\n3. Register\n4. Exit') print('=' * 30) try: choice = int(input('Enter your choice : ')) print('=' * 30) if choice == 1: template.login() if choice == 2: template.admin() elif choice == 3: template.register() template.login() elif choice == 4: print('Have a nice day !! Bye.. Bye..') print() exit() else: print('Wrong choice..') except ValueError: print('Enter proper choice..')
if pattern.search(comment.body ): # search for people correctiong others' spelling comment.reply("Thank you! You've saved someone a quarter.") print("thanked " + str(comment)) elif misspell.search(comment.body): # search for a misspell monies += 0.25 comment.reply( "If I had a quarter for every time someone misspelled Maeve, I would have $" + (str(monies) if str(monies)[-3] == "." else str(monies) + "0") + "." + footer) print("fined " + str(comment)) else: nothings += 1 newest_comment = next( r.subreddit(sub).comments(limit=1)) # get the most recent comment settings[ "maeve_last_run"] = newest_comment.created_utc # store the creation time of it as Unix timestamp # print(settings) settings[ "maeve_cash"] = monies # save current amount of hypothetical quarters dataIO.save_json("settings.json", settings) # save to file print("oof: {} comments with nothing \n \n \n".format(nothings)) print("running bot...") r = temp.login("maevie") lobot(r, "paladins") print("oof")
import template as t t.main( t.login('grohk'), # r 'grohk', # qui 'test', # sub t.misspellchk, # fun t.defaultfooter, # footer {"grohk_cash":00.00}, # jsonbackup, misc r"(?i)\b(?:ghroc?k|grog?c?k|grochk|grokh|ghroh?c|grog?hc|groghk|grhock|grhoc?k?|groh?nh?k?c?)\b", "grohk" )
) # use it to look up the tuple containing the command's text (T) and voice line link (V) if command is None: print("couldn't find vgs key") continue # if VGS key can't be found, move on to next word reply += ">{} (Evie): [[{}] {}]({}) \n \n".format( comment.parent().author.name, command, *voiceline ) # * unpacks tuple and puts all its elements into format() if len( reply ) > 0: # check if the length of the reply is more than 0 - if yes, that means we have something to reply with reply += "\n\n ^^^^^^^^^^^^^i'm ^^^^^^^^^^^^^a ^^^^^^^^^^^^^bot! ^^^^^^^^^^^^^check [^^^^^^^^^^^^^this ^^^^^^^^^^^^^post](https://www.reddit.com/user/yubbber/comments/a8q81v/about_ureevie_bot/) ^^^^^^^^^^^^^for ^^^^^^^^^^^^^info. \n \n" + footer comment.reply(reply) # reply! \o/\o/ print("tag replied to " + parentbody) tags += 1 else: nothings += 1 # print("nothing in "+str(comment)+reply) # print(settings) newest_comment = next( r.subreddit(sub).comments(limit=1)) # get the most recent comment settings[ "reevie_last_run"] = newest_comment.created_utc # store the creation time of it as Unix timestamp dataIO.save_json("settings.json", settings) # save to file print("oof: {} comments with nothing \n \n \n".format(nothings)) print("running bot...") r = temp.login("reevie") loboto(r, "paladins")
import template as t t.main(t.login('maeve'), 'maeve', 'test', t.misspellchk, t.defaultfooter, {"maeve_cash": 00.00}, r"(?i)(?:me?ai?y?u?ve|mayve?)", "maeve")
if pattern.search(comment.body ): # search for people correctiong others' spelling comment.reply("Thank you! You've saved someone a quarter.") print("thanked " + str(comment)) elif misspell.search(comment.body): # search for a misspell monies += 0.25 comment.reply( "If I had a quarter for every time someone misspelled Grohk, I would have $" + (str(monies) if str(monies)[-3] == "." else str(monies) + "0") + "." + footer) print("fined " + str(comment)) else: nothings += 1 newest_comment = next( r.subreddit(sub).comments(limit=1)) # get the most recent comment settings[ "grohk_last_run"] = newest_comment.created_utc # store the creation time of it as Unix timestamp # print(settings) settings[ "grohk_cash"] = monies # save current amount of hypothetical quarters dataIO.save_json("settings.json", settings) # save to file print("oof: {} comments with nothing \n \n \n".format(nothings)) print("running bot...") r = temp.login("grohvie") lobot(r, "paladins") print("oof")