def checkLunch(msg): nick = nickname(msg.sender) if(T.hour() < 6): botSpeak = nick + "! Don't be ridiculous. This is not the time for lunch, and you should be asleep." bot.send_message(msg.chatId, botSpeak).wait() return if(T.weekend()): botSpeak = nick + " get real! The Kista restaurants are closed on " + T.weekday() + "s" bot.send_message(msg.chatId, botSpeak).wait() return if(T.hour() < 10): botSpeak = "I think it's a bit early for lunch. Ask me after 10 again." bot.send_message(msg.chatId, botSpeak).wait() return if(T.hour() < 14): genericLunch(msg) return if(T.hour() < 18): botSpeak = "No such thing as a free lunch " + nick + ". Too late anyway." bot.send_message(msg.chatId, botSpeak).wait() return botSpeak = "At this hour, " + nick + "... I would rather recommend dinner." bot.send_message(msg.chatId, botSpeak).wait()
def greeting(): if(T.hour()<6): greetings = ["Kinda late night", "Dark night", "And you are still awake"] elif(T.hour()<10): greetings = ["Morning", "Happy Morning", "Good Morning"] else: greetings = ["Hello", "Hi", "Ciao", "Hiya", "Greetingz", "Greetings", "Howdy", "¡Hola!", "Hejsan", "Eyy"] if(T.hour()>=18): extraGreetings = ["Evening", "Good evenin'", "Good evening", "Buenas tardes"] greetings.extend(extraGreetings) print greetings return greetings[randint(0, len(greetings)-1)]
def checkNewYear(): global hiNewYear if(hiNewYear == False and T.year() == 2016 and T.month() == 1 and T.day() == 1 and T.hour() == 0 and T.minute() == 0): bot.send_message(msg.chatId, "Hey you awesome dudes").wait() bot.send_message(msg.chatId, "I just want to say...").wait() time.sleep(1.1) bot.send_message(msg.chatId, "*H*A*P*PY* *N*E*W* *Y*E*A*R*").wait() hiNewYear = True
def checkFood(msg): nick = nickname(msg.sender) if(T.hour() < 6): botSpeak = vocab.getMidnightFood(msg) bot.send_message(msg.chatId, botSpeak).wait() return if(msg.sender == "arturo"): botSpeak = vocab.getArtFood(msg) bot.send_message(msg.chatId, botSpeak).wait() return botSpeak = vocab.getFood(msg) bot.send_message(msg.chatId, botSpeak).wait()