A tool for sending fast and managed messages to Telegram bot users

Last update: Oct 3, 2021

πŸ‘‹πŸ» HiToAll

A tool for sending fast and managed messages to Telegram bot users

About

In some telegram bots programmed with php language, if there are many users of the bot, the bot will have trouble sending public messages to users and because the number of requests increases, it causes the timeout source to be sent and the message is not sent to all users. Using the simple HiToAll tool, this problem can be solved and messages can be managed in a timely manner.

Getting started

To use HiToAll, you need your bot database to use mysql. First you need to define your database information in an array:

include('hitoall.php');

define('API_KEY', ''); // Bot token

define('MYSQLI', [
    'host'=> 'localhost',
    'username'=> 'database_username',
    'password'=> 'database_password',
    'name'=> 'database_name'
]);

You then need to create a 1 minute cron job on the loop.php file. This cron job is used to manage posts per minute. You can use cron-job.org to add a cronjob, or enter the following command in the server's cronjob settings:

php -q /home/path/to/loop.php

Add to Queue

To create a new message in the send queue, just enter the sending method and information in the following format:

  • Note: In the fields where you need to enter the user's chat id, enter the phrase [*USER*]. This phrase will be replaced when sending.
// Add a new message to the queue to send to all bot users
HiToAll('sendMessage',[
    'chat_id'=>'[*USER*]',
    'text'=>'Hello Everyone!'
], $api_key=API_KEY, $mysqli=MYSQLI);

Your message will be in the queue and finally after 1 minute sending to all members of the bot will begin. Messages will be sent to 50 members of your bot every minute.

Get sending Queue

When you add a send to the queue, the id value is also returned. You can use this code to receive a list of all active sends:

// Get a array of contents waiting to be sent
$list = HiToAll('list', $api_key=API_KEY, $mysqli=MYSQLI)['list'];

Get a send info from Queue

You can use this code to receive the basic information of a post from the queue :

// Get a send with ID '15978'
$id = 15978;
$info = HiToAll('get', ['id'=>$id], $api_key=API_KEY, $mysqli=MYSQLI);

$sends = $info['send']; // Number of sends so far
$method = $info['type']; // Get send method (example: sendMessage, ...)

Remove from sending Queue

To delete or cancel a post from the queue, you can use this code:

// Delete a send with ID '15978'
$id = 15978;
HiToAll('remove', ['id'=>$id], $api_key=API_KEY, $mysqli=MYSQLI);

Adjusting the user table

The table where the user list is located is user by default, but you can set this using the users_table argument:

HiToAll('list', $users_table='botusers', $api_key=API_KEY, $mysqli=MYSQLI);

Also, the structure in which users chat id is located is on id by default. If you want to configure this manually, you can use the chatid_structure argument:

HiToAll('list', $chatid_structure='userid', $api_key=API_KEY, $mysqli=MYSQLI);

GitHub

https://github.com/ThisIsMatin/HiToAll
You might also like...

laravel package untuk memudahkan penggunaan MCA dengan Telegram Bot USDI di aplikasi Universitas Udayana.

MCA KubeMQ Laravel laravel package untuk memudahkan penggunaan MCA dengan Telegram Bot USDI di aplikasi Universitas Udayana. Motivasi Proyek ini berfu

Nov 17, 2021

Telegram bot for CC Checker with hella lotta features.

 Telegram bot for CC Checker with hella lotta features.

SDMN CHECKER BOT Telegram bot for CC Checker with hella lotta features. πŸ“ Table of Contents Dependencies / Limitations Future Scope Setting up a Hero

Jul 26, 2022

Integrate Your PHP Code With Telegram Bot API for Beginner

Documentation[https://core.telegram.org/bots/api] Resource[https://github.com/bachors/KBBI.sql] Integrate Your PHP Code With Telegram Bot API for Begi

Oct 19, 2021

Simple telegram auto reminder BOT with PHP

Telebot Script Telegram BOT Auto Reminder Dibuat pake PHP OOP Sebenernya bukan buat dipublish sih, ini cuma buat praktek PHP OOP sama praktek Commit &

May 26, 2022

Bin checker telegram bot

Bin checker telegram bot

BIN Checker Bot Test Bot: Bin Checker Bot Env API_TOKEN Bot token. START_MSG Custom start message. Deploy Heroku Railway ⚠ Warn: Still not Tested on R

Mar 6, 2022

A simple php telegram bot to check if the bin is valid or not!

Bin-Checker A simple php telegram bot to check if the bin is valid or not! Deploy FORK the Repo by clicking HERE Add your bot token in LINE 12 THEN DE

Nov 23, 2021

Simple php telegram bot.

Simple php telegram bot.

PHPTGBot Description Simple php telegram bot. Just for fun 🚧 Work In Progress 🚧 Maybe found error, since im not tested yet! Still on working, so be

Nov 24, 2021

This app remembers todo list in every specified time (e. every minute, hour, day etc) through telegram bot

remember_todo_list This app remembers todo list in every specified time (e. every minute, hour, day etc) through telegram bot This project includes tw

Nov 27, 2021

PHP Source - Telegram Bot - Standart Method

Telegram Bot- yaratish uchun mo'ljallangan standart metod asosida ishlovchi, PHP tilida yozilgan kod Dasturchilarning eng yaxshi ko'rgan odati c/p bo'

Mar 30, 2022
PHP Telegram Bot based on the official Telegram Bot API

PHP Telegram Bot based on the official Telegram Bot API

Dec 8, 2021
A Discord bot that rewards players in Minecraft for sending messages on Discord

MCRewards-Discord-Bot A Discord bot that rewards players in Minecraft for sending messages on Discord How to setup: Download this git as a .zip, or cl

Dec 26, 2021
πŸ€– Telegram Bot API PHP SDK. Lets you build Telegram Bots easily! Supports Laravel out of the box.
πŸ€– Telegram Bot API PHP SDK. Lets you build Telegram Bots easily! Supports Laravel out of the box.

Telegram Bot API - PHP SDK Telegram Bot PHP SDK lets you develop Telegram Bots in PHP easily! Supports Laravel out of the box. Telegram Bot API is an

Aug 1, 2022
SimSimi Bot - a Telegram ChatBot like the old SimSimi app that simulates a normal chat experience, created directly by users
SimSimi Bot - a Telegram ChatBot like the old SimSimi app that simulates a normal chat experience, created directly by users

SimSimi Bot - a Telegram ChatBot like the old SimSimi app that simulates a normal chat experience, created directly by users

Jul 30, 2022
Create and manage advanced polls with this Telegram Bot which has many features available!
Create and manage advanced polls with this Telegram Bot which has many features available!

MasterPollBot Create and manage advanced polls with this Telegram Bot which has many features available! Requirements Local Telegram Bot API or a webh

Jun 21, 2022
Easy to install email tracker with gui and telegram api bot with date device & ip tracking,

mail-php-tracking-with-gui ?? Simple mail tracking program that uses php, html, telegram bot, and a gui The gui The gui lets you create specific links

Jul 23, 2022
Robot increase telegram post πŸ‘β€πŸ—¨Telegram Fake Posts ViewerπŸ‘β€πŸ—¨
Robot increase telegram post πŸ‘β€πŸ—¨Telegram Fake Posts ViewerπŸ‘β€πŸ—¨

Program Features - ?? Very and stylish design. - ?? It has glass buttons. - ?? Has a professional management panel. - ?? Has a user area. - ?? Free di

May 30, 2022
A telegram bot to check credit cards. written in php & py

MRBANKER BOT A telegram bot to check credit cards. written in php & py. You can find me on telegram STEP1: goto botfather create a bot copy the token

Aug 3, 2022
NovaGram - An elegant, Object-Oriented, reliable PHP Telegram Bot Library
NovaGram - An elegant, Object-Oriented, reliable PHP Telegram Bot Library

An elegant, Object-Oriented, reliable PHP Telegram Bot Library Full Documentation β€’ Public support group Examples β€’ Features β€’ Installation ?

Jul 24, 2022
telegram bot for sell virtual number

Telefake Telegram bot for sell virtual number (fully automatic) Installation create bot in telegram upload script in website with php and ssl (https)

Oct 19, 2021