Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1"""LICENSE 

2Copyright 2020 Hermann Krumrey <hermann@krumreyh.com> 

3 

4This file is part of otaku-info-web. 

5 

6otaku-info-web is free software: you can redistribute it and/or modify 

7it under the terms of the GNU General Public License as published by 

8the Free Software Foundation, either version 3 of the License, or 

9(at your option) any later version. 

10 

11otaku-info-web is distributed in the hope that it will be useful, 

12but WITHOUT ANY WARRANTY; without even the implied warranty of 

13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 

14GNU General Public License for more details. 

15 

16You should have received a copy of the GNU General Public License 

17along with otaku-info-web. If not, see <http://www.gnu.org/licenses/>. 

18LICENSE""" 

19 

20from bokkichat.entities.message.TextMessage import TextMessage 

21from otaku_info_web.Config import Config 

22 

23 

24def handle_whoami_requests(): 

25 """ 

26 Handles whoami requests to the telegram bot 

27 :return: None 

28 """ 

29 telegram = Config.TELEGRAM_BOT_CONNECTION 

30 

31 def handler(_, msg): 

32 if msg.is_text(): 

33 msg: TextMessage = msg 

34 print(msg.body) 

35 

36 if msg.body == "/whoami": 

37 sender = telegram.address 

38 receiver = msg.sender 

39 telegram.send(TextMessage(sender, receiver, receiver.address)) 

40 

41 telegram.loop(handler)