Design of Telegram Bots For Campus Information Sha

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

IOP Conference Series: Materials Science and Engineering

PAPER • OPEN ACCESS

Design of Telegram Bots for Campus Information Sharing


To cite this article: Hari Setiaji and Irving V Paputungan 2018 IOP Conf. Ser.: Mater. Sci. Eng. 325 012005

View the article online for updates and enhancements.

This content was downloaded from IP address 139.81.123.185 on 13/03/2018 at 00:36


ICITDA 2017 IOP Publishing
IOP Conf. Series: Materials Science and Engineering 325 (2018) 012005 doi:10.1088/1757-899X/325/1/012005
1234567890‘’“”

Design of Telegram Bots for Campus Information Sharing

Hari Setiaji1, Irving V Paputungan2


1,2
Informatics Department, Universitas Islam Indonesia
2
Informatics Department, Universitas Islam Indonesia
Universiti Teknologi Petronas, Malaysia
1
hari.setiaji@uii.ac.id, 2irving@uii.ac.id

Abstract. This paper presents a design of Telegram bot to support Campus information sharing.
The communication method used is Webhooks. Webhooks is able to provide zero latency and
handle multiple requests concurrently during communication within the Telegram bot. Such bot
serves the information via specific commands. The Telegram bot prototype shows that even
though Webhooks is able to provide information as requested, Webhooks setting is difficult and
trickier.

Keyword: telegram, telegram bot, webhooks, telegram command

1. Introduction
Technology-enabled campuses are critical to a university’s survival. Aside from the obvious reasons of
the students and staff using technology on a daily basis, handheld and mobile devices have also redefined
traditional higher education culture. With mobile devices in hand, any student can find the answers to
almost any of life’s questions within seconds.
One of the most helpful features in the mobile devices is messenger. It becomes the main tool to
communicate each other, to share information and to interact. As Short Message Service (SMS)
becomes old-fashioned, people normally use messenger application such as WhatsApp, Blackberry
Messenger (BBM), and Telegram to perform direct communication. BBM was very popular in the late
2000s and after a decade, it started to lose out to WhatsApp. WhatsApp was incorporated in 2009 and
becomes a top chat app in 109 countries. Facebook then acquired WhatsApp in 2014 to make a bigger
play in the rapidly-growing messaging market, along with its own messenger platform. Recent apps
called Telegram works much like the WhatsApp, using end-to-end encryption to protect shared
information (Pinto, 2014) (Hamburger, 2014). The company claims to have over 100 million users, and
offers features like self-destructing messages to ensure greater privacy. Users can communicate directly,
either in private groups or on channels.
Latest additional feature in Telegram is Chat bots. It is a piece of program, which is based on AI and
machine learning in small level. User can interact with bots by sending commands and they will reply
with exactly what user needs as chatting with a knowledgeable friend. Such bots are customizable
depending on user requirements and integrated into various services to, such as, controlling smart home,
customized tools and other social services. In this paper, a Telegram bot to support campus information
sharing is presented.

Content from this work may be used under the terms of the Creative Commons Attribution 3.0 licence. Any further distribution
of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI.
Published under licence by IOP Publishing Ltd 1
ICITDA 2017 IOP Publishing
IOP Conf. Series: Materials Science and Engineering 325 (2018) 012005 doi:10.1088/1757-899X/325/1/012005
1234567890‘’“”

The paper is organized as follows. Section 2 presents the related work that studied telegram in the
past. The case study and the system requirements are provided in the section 3. The telegram bot design
can be seen in section 4. In section 5, simulation is shown. Preliminary findings based on the simulation
are presented in section 6 and lastly, section 7 provides the summary of the paper.

2. Related Word
There are several previous studies on the use of Telegram. Jakobsen (2015) performed cryptanalysis on
the Telegram communication. The author was able to analyse and depicts the security and encryption
protocol in the Telegram. Sutikno et al. (2016) compared WhatsApp, Viber and Telegram. The result
shows that Telegram offers better back-up feature and security then WhatsApp and Viber. The authors
added that Telegram is the best messenger platform among those three apps. In the area e-learning,
Hafiz (2015) integrates LMS e-learning and Moodle platform using MTProto open protocol. The
Telegram bot, namely ELISA (E-learning integrated short announcement) will then reply to any request
from students who need feedback of their work. In addition, the MTProto is able to support real-time
online class discussion. One more work on Telegram bot was done by Rohim (2016). The author
developed a chat bot using long polling method to share information on any offers and events from
student outlet in a campus. However, with the increasing number of request that is sent to the bots,
latency becomes an issue in that work. In our work, different communication method, namely Webhooks
method, is used within a Telegram bot to overcome the latency issue when sharing information in
campus.

3. Case Study and Requirements


Informatics Department in Islamic University of Indonesia (TF UII) takes the advantage of IT
development to deliver the information to all academics staff and students. They use web portal and
Facebook timeline as the main information sharing media. The main drawback is users do not frequently
check such media to obtain real-time info. The proposed Telegram bot will be implemented in TF UII
to provide better campus services.
The Telegram bot is required to provide information such as: TF UII profile, upcoming events, and
class or mentoring timetable. The bot will broadcast information to the registered accounts regularly.
Figure 1 shows the general framework of the telegram bot. A staff from TF UII will regularly share the
information gathered from portals and FB page to the students, staffs, and lecturers in the campus via
the Telegram bot.

Figure 1. General Framework of Telegram bot

4. Proposed Design of the Telegram Bot


Based on the aforementioned framework, a use case is developed as shown in Figure 2. Both telegram
users (student and teacher) will have to initially type the command in order to get the response from the
bot. The bot obtains the information from the available source and log activity. To check if the request

2
ICITDA 2017 IOP Publishing
IOP Conf. Series: Materials Science and Engineering 325 (2018) 012005 doi:10.1088/1757-899X/325/1/012005
1234567890‘’“”

sender is authorized, the bot will refer to group and user management. Figure 3 illustrates how the
system prototype is developed. MySQL as the database system, Python as the programming language
and protection mechanism have incorporated within the bot to perform the information dissemination
via Telegram.

Figure 2. Bot UII use case diagram

internet

Figure 3. Telegram bot prototype

There are two (2) communication methods for communication within Telegram bot, they are
Webhooks (7) and Long polling (8). Basically, Webhooks method is easier to be developed, HTTP based
request and fast when responding to a request. However, it needs a dedicated server with public IP
while long polling needs no dedicated server. Long polling method reduces the cost of creating home
automation. It can support large number of updates without necessarily having an API call for every
update. Such home automation can be more secure with additional devices. In this implementation,
Webhooks is then chosen because the requested information must be fast responded and live 24/7.

3
ICITDA 2017 IOP Publishing
IOP Conf. Series: Materials Science and Engineering 325 (2018) 012005 doi:10.1088/1757-899X/325/1/012005
1234567890‘’“”

5. Simulation
The telegram bot works in two ways: 1) as an information media and 2) as a position tracker. As the
information media, the bot will reply any commands from users in the campus. The bot will
automatically validate the information gathered from each URLs given. Figure 4 shows one simulation
of command and replied message. As the position tracker, the bot can also keep the location given by
the lecturer and forward the position to the students who want to meet the lecturer. Figure 5 and 6
depicts the simulation of inquiring a position using chat-bot telegram. Figure 7 shows the web-based
platform for the system administrator to manage the bot.

Figure 4. Simulation of bot as the information media

Figure 5. Simulation of bot as the position tracker

Figure 6. Full Chat bot telegram platform

4
ICITDA 2017 IOP Publishing
IOP Conf. Series: Materials Science and Engineering 325 (2018) 012005 doi:10.1088/1757-899X/325/1/012005
1234567890‘’“”

Figure 7. Web-based bot dashboard

Figure 8. Response time measurement on several requests

6. Findings
There are some preliminary findings after the simulation of Telegram bot prototype. Telegram bot is
able to aggregate all the information stored in the database and deliver such information to the users as
requested. With some extension during code development, location can also be collected by the bot
from the users and visualised clearly to the users. Analysis on the bot performance has also been
conducted as shown in Figure 8. Response time was measured on different cases to see how fast the bot
is responding to the requests. Bot is able to respond most of the requests in less than 0.5 seconds which
is considerably satisfactory.

5
ICITDA 2017 IOP Publishing
IOP Conf. Series: Materials Science and Engineering 325 (2018) 012005 doi:10.1088/1757-899X/325/1/012005
1234567890‘’“”

7. Summary
In this paper, design and prototype of Telegram bot is presented. The bot is able to perform repeated
simple and complicated tasks, such as invoking and validating the information available in the database.
Communication with the bot uses very simple commands and is supported by Webhooks method. Using
such method, visual interface can also be developed. The development of visual interface for the chat-
bot becomes the future work.

References
[1] Hafiz M 2015 ELISA: E-Learning Integrated Short Announcement Colloquium in Computer and
Math. Sci. Education p 110.
[2] Jakobsen J B 2015 A Practical Cryptanalysis of The Telegram Messaging Protocol (AARHUS
University).
[3] Rochim H N 2016 Rancang Bangun Telegram Bot pada Telegram Messenger dengan Metode
Long Polling untuk Koperasi Kopma UGM (Universitas Gadjah Mada).
[4] Sutikno T, Handayani L, Stiawan D, Riyadi M A, Much I, and Subroto I 2016 WhatsApp, Viber
and Telegram: which is the best for instant messaging? Int. J. of Electrical and Computer Eng.
(IJECE) 6(3) 909–14. http://doi.org/10.11591/ijece.v6i3.10271
[5] Pinto R 2014 Secure Instant Messaging Master Thesis (Department of Computer Science and
Engineering, Frankfurt University).
[6] Hamburger E 2014 Why Telegram has become the hottest messaging app in the world - The Verge
[online] Available: http://www.theverge.com/2014/2/25/5445864/telegram-messenger-
hottest-app-in-the-world [Accesed 16-Feb-2017].
[7] Webhooks - https://webhooks.pbworks.com/w/page/13385124/FrontPage
[8] Long Polling - https://tools.ietf.org/html/rfc6202

You might also like