Fakultas Ilmu Komputer UI

Commit 51ff04cc authored by zakiraihan's avatar zakiraihan
Browse files

try using html

parent be2f7451
......@@ -73,7 +73,7 @@ def sendNotifSisurat():
else:
textNotif = createNotifSisurat(req_data)
param = urllib.parse.urlencode({'chat_id': user.chatId, 'text': textNotif})
url = "https://api.telegram.org/bot" + TOKEN + "/sendMessage?" + param + "&parse_mode=markdown"
url = "https://api.telegram.org/bot" + TOKEN + "/sendMessage?" + param + "&parse_mode=HTML"
r = requests.get(url = url)
return r.json()
......
def createNotifSisurat(data):
if (data['type'] == 0):
return '#### Pengumuman Sisurat Fasilkom UI,\n**Judul Surat:** %s\n**Milik akun:** %s \n**Status:** Baru Diajukan.\nTerima Kasih,\nsurat.cs.ui.ac.id' % (data['judulSurat'], data['username'])
return '''
<h4>Pengumuman Sisurat Fasilkom UI</h4>
<p><b>Judul Surat:</b> %s</p>
<p><b>Milik akun:</b> %s</p>
<p><b>Status:</b> Baru Diajukan</p>
<p>Terima Kasih,</p>
<a href='surat.cs.ui.ac.id'>surat.cs.ui.ac.id</a>
''' % (data['judulSurat'], data['username'])
elif (data['type'] == 1):
return '''
Pengumuman Sisurat Fasilkom UI,\n
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment