Curl Bot

Basic curl bot post command in PHP – Google Groups

Michael Wigleunread, Sep 13, 2016, 11:08:38 AM9/13/16to GroupMe API SupportI’m not very familiar with curl but am able to manually type the curl command for posting as my bot (curl -d ‘{“text”: “Your message here”, “bot_id”: “BOT_ID”}’). However, I don’t know how to launch that command in PHP. I know I need to use curl_exec() but don’t know exactly how that translates. Can anyone give me a quick PHP example that would run the above command using curl_exec()? Message has been deletedMichael Wigleunread, Sep 13, 2016, 1:10:16 PM9/13/16to GroupMe API SupportLooks like I found my answer. However, I’m using PHP5 instead of any curl code. It seems a little cleaner to me… Here’s the PHP code that appears to do the job (BOT_ID is obviously your bot’s ID): Your message here’, ‘bot_id’ => ‘BOT_ID’);// use key ” even if you send the request to options = array( ” => array( ‘header’ => “Content-type: application/x-www-form-urlencoded\r\n”, ‘method’ => ‘POST’, ‘content’ => _build_query($data)));$context = stream_context_create($options);$result = file_get_contents($url, false, $context);if ($result === FALSE) { /* Handle error */}var_dump($result);? >On Tuesday, September 13, 2016 at 11:08:38 AM UTC-4, Michael Wigle wrote:I’m not very familiar with curl but am able to manually type the curl command for posting as my bot (curl -d ‘{“text”: “Your message here”, “bot_id”: “BOT_ID”}’). Can anyone give me a quick PHP example that would run the above command using curl_exec()?
Sending a notification message to Telegram using its HTTP ...

Sending a notification message to Telegram using its HTTP …

# Use this script to test that your Telegram bot works.
#
# Install the dependency
# $ gem install telegram_bot
# Run the bot
# $ ruby
# Send a message to the bot to get the current chat’s ID in the console output.
# If it’s a group chat, invite them to the chat first.
require ‘logger’
require ‘telegram_bot’
TELEGRAM_BOT_TOKEN = “YOUR_BOT_API_TOKEN”
bot = (token: TELEGRAM_BOT_TOKEN, logger: (STDOUT))
t_updates(fail_silently: true) do |message|
puts “@#{}: #{}”
puts “Chat-ID: #{}”
end
Telegram example of how to use CURL for windows 10 to ...

Telegram example of how to use CURL for windows 10 to …

I found the following curl example to use a telegram bot to message a user. But that is written in PHP.
Is there an example of how to use the curl command in windows 10 command prompt to send a message to myself in telegram messenger?
asked Jul 1 at 15:37
0
You haven’t mentioned the PHP code, but using CURL you can simply call:
curl
Replace 123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11 with your own bot token and 1234 with your id. Don’t forget to start the bot before messaging yourself.
answered Jul 2 at 19:08
Ali PadidaAli Padida9129 silver badges22 bronze badges
Not the answer you’re looking for? Browse other questions tagged windows curl telegram command-prompt telegram-bot or ask your own question.

Frequently Asked Questions about curl bot

Leave a Reply

Your email address will not be published. Required fields are marked *