Telegram bot (telebot.py) - Trustmania/PGO-mapscan-opt GitHub Wiki

created by @nodex0 with help on fixes from @seikur0 and traductions by @CaptainPoireau and @dikkedeur

The telebot is a Telegram bot for multiple users using the same big map. The bots aim is to send to different users nearby interesting pokemon, receiving just notifications from around himself and not from the whole map. The bot features:

  • customizable messages with unicode compatibility, so you can use every strange non-ascii character
  • custom settings on a per user basis, every user can customize his location, radius, and ignored pokemon
  • fancy button interface on Telegram, users don't need to understand commands, just click around
  • do not disturb feature, to block notifications daily on a time interval

Main button interface on telegram

Getting started

After updating your configuration file telebotsettings.json with the appropriate settings, start the bot script with python telebot.py. Now message the bot on telegram with the command /start, and your are good to go!

Settings file (telebotsettings.json in res folder)

The telebotsettings.json.example file without comments looks like this:

{
	"language" : "english",
	
	"ignored_by_default" : [1,2,4,5,7,8,10,11,13,14,16,17,18,19,20,21,22,23,24,25,27,29,30,32,33,35,37,39,41,42,43,44,46,48,50,52,54,56,58,60,61,63,64,66,67,69,70,72,73,74,75,77,79,81,83,84,86,88,90,92,93,96,98,99,100,102,104,109,111,115,116,118,119,120,122,128,129,133,138,140,147],

	"radius_by_default" : 300,
	"radius_step" : 100,
	"radius_max" : 10000,

	"time_between_cycles" : 10,
	"max_notis_per_user_and_cycle" : 4,

	"log_notifications" : true,
	"log_to_file" : true,

	"TELEGRAM_BOT_TOKEN" : "YOUR_TELEGRAM_TOKEN_GOES_HERE",

	"info_about" : "This is a great bot."
}

Language

The language that the bot will use to message the users, currently supporting spanish/english/french/dutch

Ignored by default

The list of pokemon IDs that are ignored by default on first location reception

Radius by default, radius step and radius max

radius_by_default is the radius set on first contact with the user, the radius step is how much the radius will increase or decrease with each button press, and the radius_max is the maximum settable radius

Time between cycles, max notis per user and cycle

time_between_cycles is the time (or period) that it will take between cycles to check the DDBB for pokemon spawns, and the max_notis_per_user_and_cycle is the maximum notifications that will be send each cycle to one user

Log notifications, log to file

log_notifications activated means that each notification sent to user will be logged, and log_to_file means that the console log will also be send to a file in res/telegram_bot.txt

Telegram bot token

On here you have to put the token of your telegram bot, and it can only be used by one telegram application at a time (dont try using the notifications of the map for telegram, and this bot, with the same token!)

Info about

The text in this field will be shown upon pressing the info button on the bot interface