Git Product home page Git Product logo

telegram-bot's Introduction

Telegram-Bot

A PHP Laravel Telegram Bot

License

GPL-3.0-Only GNU GPL VERSION 3(GPL-3.0-only)

Versions

Fedora

Nginx GCC OpenSSL

PHP Composer cURL

Laravel

Mariadb

Redis jemalloc

Install

I recommend using systemd to manage laravel queue workers, and systemd-timer to manage laravel schedules.

This is a doc of supervisor + crontab version that laravel recommended.

You can do anything you want.

dnf update --refresh -y
dnf install supervisor podman* cockpit* --refresh -y
systemctl enable --now supervisord.service
systemctl enable --now nginx.service
systemctl enable --now php-fpm.service
systemctl enable --now container-mariadb.service
systemctl enable --now container-redis.service

composer install
chown -R www:www .
chmod -R 755 .
chmod -R 777 bootstrap/cache/
chmod -R 777 storage/

touch .user.ini
vim .user.ini
chown www:www .user.ini
chmod 644 .user.ini
chattr +i .user.ini

php artisan key:generate
vim .env

vim supervisor/TelegramBot-Queue-default.ini
vim supervisor/TelegramBot-Queue-TelegramLimitedApiRequest.ini
chmod +X supervisor/init.sh
chmod +X supervisor/restart.sh
supervisor/init.sh
supervisor/restart.sh

Database Migration

php artisan migrate

GetWebHookInfo

php artisan command:GetWebhookInfo

SetWebhook

php artisan command:SetWebhook

DeleteWebhook

php artisan command:DeleteWebhook

Restart Queue Workers

If you edited anything, you may need to restart queue workers, to make sure they are using the new configuration, or the new codes to be run.

Otherwise, they may update to the latest configurations and codes after 3600 seconds at most.

So you can send the signal to restart queue workers, via the laravel official command:

php artisan queue:restart

Or force restart with supervisor(not recommended):

supervisor/restart.sh

Or you can let bot call the laravel official command:

Send a message to the bot with the command /restart

Authors

@jyxjjj

@bluebird_tg

Donate

Alipay Alipay QRCode

telegram-bot's People

Contributors

jyxjjj avatar dependabot[bot] avatar

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.