def eid(message): app.logger.debug('Detected eid command {!r}'.format(message.text)) eid_greeting = ( 'Taqabbalallahu minna wa minkum, shiyaamana wa shiyaamakum. ' 'Mohon maaf lahir dan batin ya guys. ' 'Dari {} dan keluarga.'.format(message.from_user.first_name)) bot.send_message(message.chat.id, eid_greeting)
def hbd(message): app.logger.debug('Detected hbd command {!r}'.format(message.text)) try: if message.text.startswith('/hbd'): _, name = message.text.split(' ', maxsplit=1) else: name = message.text except ValueError: app.logger.debug('Cannot split text {!r}'.format(message.text)) bot.reply_to(message, 'Siapa yang ultah?', force_reply=True) else: app.logger.debug('Extracted hbd name {!r}'.format(name)) greetings_format = ('hoi {}' ' met ultah ya moga sehat dan sukses selalu ' '\U0001F389 \U0001F38A') greetings = greetings_format.format(name) bot.send_message(message.chat.id, greetings)
def kawin(message): app.logger.debug('Detected kawin command {!r}'.format(message.text)) try: if message.text.startswith('/kawin'): _, couple = message.text.split(' ', maxsplit=1) else: couple = message.text except ValueError: app.logger.debug('Cannot split text {!r}'.format(message.text)) bot.reply_to(message, 'Siapa yang mau kawin jir?', force_reply=True) else: app.logger.debug('Extracted kawin couple {!r}'.format(couple)) kawin_greeting = ('Hoi {} selamat nikah & kawin ya! ' 'Semoga jadi keluarga yang bahagia. ' 'Semoga lancar semuanya sampai enna-enna. ' 'Dari {} dan keluarga.'.format(couple, message.from_user.first_name)) bot.send_message(message.chat.id, kawin_greeting)
def xmas(message): app.logger.debug('Detected xmas command {!r}'.format(message.text)) xmas_greeting = ('Selamat natal semua! ' 'Dari {} dan keluarga.'.format(message.from_user.first_name)) bot.send_message(message.chat.id, xmas_greeting)
def eid(message): app.logger.debug('Detected eid command {!r}'.format(message.text)) eid_greeting = ('Taqabbalallahu minna wa minkum, shiyaamana wa shiyaamakum. ' 'Mohon maaf lahir dan batin ya guys. ' 'Dari {} dan keluarga.'.format(message.from_user.first_name)) bot.send_message(message.chat.id, eid_greeting)
def notify(message): """Send notification to TululBot developers group.""" from tululbot import bot chat_id = environ['TULULBOT_DEVEL_CHAT_ID'] bot.send_message(chat_id, message)