English 中文(简体)
我如何让机器人在开端发出信息?
原标题:how do I get the bot to send a message at startup?
  • 时间:2023-12-10 18:40:38
  •  标签:
  • telegram

我如何让机器人在开端发出信息?

it didn t work out in BotFather, you can only create a bot and its profile there. in Manubot, advertising after the actions performed, even some services complement messages that are not even added.

问题回答

你们必须使用方案拟订语言来规范机器人。 这是标准的方法。 例如,用假日,你可以:

Install Zhu

图书馆:

pip install pyTelegramBotAPI

bot.py:

import telebot

BOT_TOKEN = `YOU_BOT_TOKEN_HERE`

bot = telebot.TeleBot(BOT_TOKEN)

# send message at startup
@bot.message_handler(commands=[ start ])
def send_welcome(message):
    bot.reply_to(message, "Howdy, how are you doing?")

执行:

python bot.py

这将发挥作用。

为了提供24/7,你必须把它放在像Heroku、谷歌云或一些东西这样的云层托管者身上。





相关问题
Telegram API, how to add newlines?

Tried many way with parse_mode: Markdown or HTML: curl -s "https://api.telegram.org/bot$botToken/sendMessage" -H Content-Type: application/json -d { "parse_mode": "HTML&...

How to download all shared media files from a telegram group?

There is a telegram group with more than 40,000 shared files in it. Is there any bot to download all of them all at once? If not is there any telegram api script method using python to download shared ...

show specific user page in Telegram

I m creating an app by phonegap and I want to open Telegram groups or channels from my app. In other mean when I click on a group , Telegram open and that group shows to user. I used the following ...

I have a bot in telegram can I delete user s messages?

I am writing a bot on JS using grammy bibliothek I made a function createStickerPack everything works but I need to make it so that when the user sends sticker pack names after creating a sticker the ...

热门标签