Git Product home page Git Product logo

telegram_bot_message_with_php_codeigniter's Introduction

telegram_bot_message

Send bot messages from php codeigniter to telegram

Step 1:Search "botfather" in telegram and enter it

Step 2:Send message "/newbot" alt text

Step 3:So it will ask bot name type the bot name (eg:"telegram_bot_message") after that it will ask username of bot it should end with _bot eg:example_php_tele_bot, after that it will give you the bot token as like below image

Step 4:Search the bot username and enter it and add the bot into your group image

Step 5:Enter /start that group and HIT this url https://api.telegram.org/bot<bot_token>/getUpdates
bot_token which we git while creating the bot
In that URL you will find the group chat_id note that too.. image

Step 6:Get the lib telegram in the location "telegram_bot_message/application/libraries/" and get the config file "telegram.php" from the location "telegram_bot_message/application/config/" and place into your codeigniter setup and autoload the lib in autoload.php in config folder

$autoload['libraries'] = array("telegram/telegram_lib");

Step 7:Config the bot_token and chat_id in telegram config file
chat_id will your group id or any user id in that JSON image

$config['bot_token'] = 'BOT_TOKEN';

$config['chat_id'] = 'CHAT_ID';

Step 8:Start use the below lib functions in all your controller

  • $this->telegram_lib->sendmsg("test")
  • $this->telegram_lib->sendlocation("12.114","72.100")@lat,@long
  • $this->telegram_lib->sendimg("/path/to/img","img caption")@img path,@caption=optional
  • $this->telegram_lib->sendaudio("/path/to/audio","audio caption")@audio path,@caption=optional
  • $this->telegram_lib->senddoc("/path/to/doc","doc caption")@doc path,@caption=optional
  • $this->telegram_lib->sendvenue("12.114","72.100","title","address")@lat,@long,@title,@address
  • $this->telegram_lib->sendcontact("9874651230","first name","last name")@phone,@first_name,@last_name=optional

it works!!!!!!

image


Thank you,
Prasaath V
ZcodiaTech

telegram_bot_message_with_php_codeigniter's People

Contributors

prasaath6 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.