Claim your Biolink Click Here
1 like 0 dislike
in Education & Reference by (1.6k points) | 229 views

1 Answer

0 like 0 dislike
Best answer

First Creating a new bot -> via
Use the /newbot command to create a new bot. The BotFather will ask you for a name and username, then generate an authentication token for your new bot.

The name of your bot is displayed in contact details and elsewhere.

The Username is a short name, to be used in mentions and links. Usernames are 5-32 characters long and are case insensitive, but may only include Latin characters, numbers, and underscores. Your bot's username must end in 'bot', e.g. 'tetris_bot' or 'TetrisBot'.

The token is a string along the lines of 110201543:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw that is required to authorize the bot and send requests to the Bot API. Keep your token secure and store it safely, it can be used by anyone to control your bot.

BotFather, [09-08-2022 11:43]
Alright, a new bot. How are we going to call it? Please choose a name for your bot.

MARC, [09-08-2022 11:44]

BotFather, [09-08-2022 11:44]
Good. Now let's choose a username for your bot. It must end in bot. Like this, for example: TetrisBot or tetris_bot.


Done! Congratulations on your new bot. You will find it at You can now add a description, about section and profile picture for your bot, see /help for a list of commands. By the way, when you've finished creating your cool bot, ping our Bot Support if you want a better username for it. Just make sure the bot is fully operational before you do this.

Use this token to access the HTTP API:
Keep your token secure and store it safely, it can be used by

Get Update and chat ID

Send Message via HTTP API

VIA PHP Function

vi func.php

function sendMessage($chatID, $messaggio, $token) {
    echo "sending message to " . $chatID . "\n";

    $url = "" . $token . "/sendMessage?chat_id=" . $chatID;
    $url = $url . "&text=" . urlencode($messaggio);
    $ch = curl_init();
    $optArray = array(
            CURLOPT_URL => $url,
            CURLOPT_RETURNTRANSFER => true
    curl_setopt_array($ch, $optArray);
    $result = curl_exec($ch);
    return $result;


vi send.php

$token = "5489378422:AAGZ9FRCkZorhHdhd&hd83JVe4XoIrve_E";
$chatid = "102456789";
sendMessage($chatid, "Oracle DB is Down", $token);

by (4.7k points)
0 0

if ping -c 1 YOUR_IP/Domain &> /dev/null
   #php /var/www/html/botApp/send.php
  echo 1
  php /var/www/html/botApp/send.php

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
1 like 0 dislike
1 answer
asked Apr 15, 2014 in Education & Reference by Yogi (460 points) | 307 views
0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
asked Jun 27, 2019 in Education & Reference by Simmi (820 points) | 305 views

Where your donation goes
Technology: We will utilize your donation for development, server maintenance and bandwidth management, etc for our site.

Employee and Projects: We have only 15 employees. They are involved in a wide sort of project works. Your valuable donation will definitely boost their work efficiency.

How can I earn points?
Awarded a Best Answer 10 points
Answer questions 10 points
Asking Question -20 points

1,314 questions
1,476 answers
4,809 users