Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ZAKI RAIHAN
1606878505_ossd_telegram_notif_bot
Commits
51ff04cc
Commit
51ff04cc
authored
Oct 11, 2019
by
zakiraihan
Browse files
try using html
parent
be2f7451
Changes
2
Hide whitespace changes
Inline
Side-by-side
app.py
View file @
51ff04cc
...
...
@@ -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
()
...
...
telebot/sisuratNotif.py
View file @
51ff04cc
def
createNotifSisurat
(
data
):
if
(
data
[
'type'
]
==
0
):
return
'#### Pengumuman Sisurat Fasilkom UI,
\n
**Judul Surat:** %s
\n
**Milik akun:** %s
\n
**Status:** Baru Diajukan.
\n
Terima Kasih,
\n
surat.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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment