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
d868b225
Commit
d868b225
authored
Oct 11, 2019
by
zakiraihan
Browse files
Reformating template
parent
77b01366
Changes
2
Hide whitespace changes
Inline
Side-by-side
app.py
View file @
d868b225
...
...
@@ -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
url
=
"https://api.telegram.org/bot"
+
TOKEN
+
"/sendMessage?"
+
param
+
"&parse_mode=markdown"
r
=
requests
.
get
(
url
=
url
)
return
r
.
json
()
...
...
telebot/sisuratNotif.py
View file @
d868b225
def
createNotifSisurat
(
data
):
if
(
data
[
'type'
]
==
0
):
return
'''
Pengumuman Sisurat Fasilkom UI
,
\n
Judul Surat: %s
Milik akun: %s
Status: Baru Diajukan.
\n
Terima Kasih
,
\n
surat.cs.ui.ac.id
<p>
Pengumuman Sisurat Fasilkom UI
</p><br>
<p>
Judul Surat: %s
</p><br>
<p>
Milik akun: %s
</p><br>
<p>
Status: Baru Diajukan.
</p><br>
<p>
Terima Kasih
</p><br>
<p>
surat.cs.ui.ac.id
</p>
'''
%
(
data
[
'judulSurat'
],
data
[
'username'
])
elif
(
data
[
'type'
]
==
1
):
return
'''
...
...
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