Beispiel #1
0
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()
Beispiel #2
0
	def fixAlias(self, phrase, msg):
		resp = phrase
		if(msg.nick == ""):
			# No override use defaults
			nick = self.nickname(msg.sender)
		else:
			nick = msg.nick

		helgaNick = self.rnd(self.helga)
		resp = resp.replace(u"#nick#", nick)
		resp = resp.replace(u"#weekday#", T.weekday())
		resp = resp.replace(u"Helgafjäll", helgaNick)
		return resp
Beispiel #3
0
def checkMorning(update):
	chat_id = update.message.chat.id
	first_name = update.message.sender.first_name
	botSpeak = "Good morning " + nickname(first_name) + ", thank God it's " + T.weekday() + "!"
	bot.send_message(chat_id, botSpeak).wait()