/Postgram

A telegram bot for manage post in channels or groups

Primary LanguagePHP

Postgram

Send post on telegram, certain time

Libraries:

  1. Telegram bot api
  2. Database
  3. Jalali Date

Instalation:

  1. library install:
$ composer install
  1. DataBase Install
$ mysql -u <username> -p
mysql> create database postgram_bot;
mysql> create database postgram_bot_fake;
  1. Import database:
$ mysql -u <username> -p postgram_bot < db_sql/postgram_bot.sql
$ mysql -u <username> -p postgram_bot_lib < db_sql/postgram_bot_lib.sql
  1. Remove sample library Commands:

when run bot, probably command not run or run a response in loop. check this path and remove similar command:

PROJECT_PATH/vendor/longman/telegram-bot/src/Commands

Config:

Set all configs in:

PROJECT_PATH/src/config/config.json

JUST THIS :)

Set lib db config:

in PROJECT_PATH/getUpdateCLI.php from line 19 set library db config. it's just fake for prevent lib exeption. :-(

$mysql_credentials = [
  'host' => "localhost",
  'user' => "yourUsername",
  'password' => "yourPassword",
  'database' => "postgram_bot_lib"
];

Run:

$ php getUpdateCLI.php

FAQ:

  1. why two database? :(
  2. Which databases uses bot? postgram_bot.sql