#!/usr/local/bin/python2.7 # -*- coding: utf-8 -*- import telegram import datetime from emoji import emojize import sys reload(sys) sys.setdefaultencoding('utf-8') if __name__ == '__main__': if len(sys.argv) != 4: print(len(sys.argv)) exit(-1) recipient = sys.argv[1] subject = sys.argv[2] body = sys.argv[3] now = datetime.datetime.now() #message = "-----------------------------------------\n\nDate : %s\nSubject: %s\n\n%s" % (now, subject, body) message = "%s" % subject if ("PROBLEM:" in message): message = emojize(message.replace("PROBLEM:",":rage:"), use_aliases=True) elif ("OK:" in message): message = emojize(message.replace("OK:",":smile:"), use_aliases=True) elif ("Auto registration:" in message): message = emojize(":satellite: %s" % message, use_aliases=True) bot = telegram.Bot(token='봇토큰키') bot.send_message(chat_id=recipient, text=message, use_aliases=True)
아래처럼 이모티콘을 활용해서 좀 더 편하게 확인할 수 있습니다.