Giter VIP home page Giter VIP logo

tg_raidbot's Introduction

Description

tg_raidbot is a configurable Telegram raid summary bot for scanner systems like RDM and MAD (currently only RDM is supported).

Features

  • Configurable message templates with some keywords (see '[templates]' chapter in config.toml.example)
  • Configurable time format for raid start / end times
  • Multiple languages supported for raidnames, pokemon names and attacks: de, en, es, fr, hi, id, it, ja, ko, pl, pt-br, ru, sv, th, tr, zh-tw
  • Chat topics support (see Telegram-Blog)
    • Remark: you need to enable thsi feature first in group setting -> enable 'Topics' switch
  • Multiple raid chats, each with following individual configuration:
    • choose, if raids are grouped by raid level or only ordered by time
    • choose time order (latest or earliest end time first)
    • geofence support
    • include or exclude raid eggs
    • automatically pin message (activate or deactivate)

Limitations

Only RDM is supported for now. Extension to support additional scanner systems should be easy by extending scannerconnector.py. PRs welcome.

Installation

It is highly recommended to use virtual python environment (example here with virtualenv plugin).

  • create environment: virtualenv -p python3 ~/<your-venv-folder>/tg_raidbot_env
  • clone github repo: git clone https://github.com/hamster007Github/tg_raidbot.git
  • cd tg_raidbot
  • install dependencies:~/<your-venv-folder>/tg_raidbot_env/bin/pip3 install -r requirements.txt
  • cp config.toml.example config.toml
  • adapt config.toml for your needs
  • run script: ~/<your-venv-folder>/tg_raidbot_env/bin/python3 run.py

PM2 example setup

Based on the examples in Installation you can use following ecosystem file (linux user myuser):

{
    name: 'tg_raidbot',
    script: 'run.py',
    cwd: '/home/myuser/<your-installation-folder>tg_raidbot',
    interpreter:'/home/myuser/<your-venv-folder>/tg_raidbot_env/bin/python3',
    instances: 1,
    autorestart: true,
    restart_delay: 10000,
    watch: false,
    max_memory_restart: '100M'
}

config.toml options

For now, see config.toml.example file. All options are described there.

example 1

  • public channel: @blub
  • show raids level 5 and 6 (mega) including raid eggs grouped by raid level. First level 5, second level 6
  • raids with earliest end time should be showed first
  • no geofence filtering (all raids in database). Remark: by don't provide geofence parameter
[[raidconfig]]
chat_id = "@blub"
raidlevel = [5,6]
eggs = true
raidlevel_grouping = true
order_time_reverse = false

example 2

  • private group chat_id: -987654321
  • show only already started raids level 1, 2 and 3 not grouped by raid level, only by time
  • raids with latest end time should be showed first
  • only raids in rectangular geofence between lat:40.0 lon:7.0 and lat:50.0 lon:8.0
[[raidconfig]]
chat_id = "-987654321"
raidlevel = [3,2,1] # remark: order will have no effect, because of 'raidlevel_grouping = false'
eggs = false
raidlevel_grouping = false
order_time_reverse = true
geofence = "40.0 7.0, 40.0 8.0, 50.0 8.0, 50.0 7.0, 40.0 7.0"

Credits

WatWowMap/pogo-translations, where the pogo translation data are fetched from.

tg_raidbot's People

Contributors

hamster007github avatar

Stargazers

 avatar

Watchers

 avatar  avatar

tg_raidbot's Issues

"deallocating None" issue after some runtime

Issue effect

Script is crashing with deallocating None error after some hours of runtime.

First guess after some research

A possible reason could be a None deallocating issue inside used python module mysql-connector-python version 8.0.33 in context with connect() / disconnect(). In combination of many connect() / disconnect() cycles in the tg_raidbot scipt (because for every raidlevel request a new connection is created and closed), this can lead to the script crash.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.