Comments (4)
in postgres i figured out using
myapp-postgresql:
image: postgres:9.6.2
volumes:
- ../docker-postgresql-multiple-databases:/docker-entrypoint-initdb.d
environment:
- POSTGRES_MULTIPLE_DATABASES: db1,db2
- POSTGRES_USER: myapp
- POSTGRES_PASSWORD:
allows me to use different databases in postgres, but running a couple instances of the bot for each room cause a weird update error, and i wasn't able to do that list with CHAT_ID
from telegram-stats-bot.
Currently there is not a way to make one bot instance handle multiple chats. It was always on the list, but I've been quite busy lately and haven't had the chance to look at it (and there are some changes to the Telegram bot API I need to double check). As far as I know, there should be no problem in using the same Postgres, but you need to make sure each bot service is pointing to the correct database (with the POSTGRES_DB
environment var), so you might have:
bot1:
image: mkdryden/telegram-stats-bot:master
depends_on:
- db
environment:
TZ: "America/Toronto"
BOT_TOKEN: 111111111:AAA-MpBVQ7i2cIRfwedfsfesdg6webc0r-Y
CHAT_ID: 0
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_HOST: db
POSTGRES_DB: telegram_bot_1
bot2:
image: mkdryden/telegram-stats-bot:master
depends_on:
- db
environment:
TZ: "America/Toronto"
BOT_TOKEN: 111111111:AAA-MpBVQ7i2cIRfwedfsfesdg6webc0r-Y
CHAT_ID: 0
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_HOST: db
POSTGRES_DB: telegram_bot_2
From your config, I assume you are using the init script from here. Postgres 9.6 is probably too old to be supported, I think you need at least 12. I didn't look that close, but the script will probably work with later versions too.
from telegram-stats-bot.
ive got this working, however using the same bot token for multiple bots gave weird results so i had to create a new bot for each of my 30 chats, which is a bit excessive but it works for now
from telegram-stats-bot.
as a side note, you get banned from botfather for 24 hours every 5th new bot you make within an hour. so a multiple group function would be a lot more efficient
from telegram-stats-bot.
Related Issues (20)
- Importing historical stats HOT 4
- Are you planning to update it to work in the newly implemented "topics" feature? HOT 3
- I GET THIS ERROR WHILE CREATING A TELEGRAM BOT. SOMEONE PLEASE HELP ME 😭 HOT 1
- Titles plot fails for some image dimensions
- import script causes db issues HOT 4
- json import: Pandas error HOT 1
- json import: ignore bot messages
- Not working when connecting to my cloud db
- /stats user doesnt work no more HOT 3
- shorten usernames in /stats view (or display the displayname instead)? HOT 1
- [IMPROVEMENT] Use short, not parameterized, commands to be able to setup BotFather bot commands shortcuts HOT 1
- Usernames issue (not updating on import causing duplicated userID entries) HOT 4
- 2 bugs HOT 5
- Can it get messages from past? HOT 3
- Make tests for db insertions/updates
- Support to non-ascii-safe names HOT 2
- Somehow some words are changed in /stats words HOT 2
- Why is this program that enjoyable? HOT 1
- ImportError: cannot import name 'Animation' from 'telegram' HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from telegram-stats-bot.