basta autobot 'to sa telegram
def echo(bot, data):
if not data.msg.args:
return data.reply("Maglagay ka ng message na gustong ma echo.")
bot.send_message(
data.chat.id,
f"ECHO: {data.msg.args}"
)
config = dict(
# (required) command name
name = "echo",
# (required) the main command function
run = echo,
# enter your name
author = "Greegmon",
# Posible value member, admin, botadmin or same as 0,1,2 (integer)
# 0|member = All user
# 1|admin = Chat administrator
# 2|botadmin = Bot admin
permisdion = 'member',
# how to use your command
usage = "{p}echo [text]",
# short desc of your command
description = "Your text.."
){p} = bot prefix
def function(bot, event):
markup = bot.types.InlineKeyboardMarkup()
markup.add(
bot.types.InlineKeyboardButton("Button 1", callback_data='btn1')
bot.types.InlineKeyboardButton("Button 2", callback_data='btn2')
)
bot.send_message(event.chat.id,
"This is my test",
reply_narkup = markup
)
@bot.callback('btn1') # callback_data
def my_callback(cb):
bot.send_message(event.chat.id, "Someone pressed the Button 1")def testCommand(bot, data):
# method 1
bot.send_message(data.chat.id, "My reply")
# method 2
data.reply("My reply")LINK: Telebot Documentation
di ko alam ilalagay ko, basta sa event types 'to.
- text – Plain text messages.
- audio – Audio files (e.g., music or voice memos in MP3 format).
- document – Files like PDFs, ZIPs, DOCXs.
- animation – Animated GIFs (treated as video).
- photo – Image files (e.g., JPEG, PNG).
- video – Video files (e.g., MP4).
- video_note – Round, short video messages.
- voice – Voice messages (OGG format).
- game – Telegram HTML5 games.
- sticker – Static or animated Telegram stickers.
- dice – Random dice roll (🎲, 🎯, etc.).
- location – Shared GPS location.
- contact – Shared contact information.
- venue – Shared location with name and address.
- new_chat_members – New member(s) joined the group.
- left_chat_member – A member left or was removed.
- new_chat_title – Chat title was changed.
- new_chat_photo – Chat photo was updated.
- delete_chat_photo – Chat photo was removed.
- group_chat_created – A basic group was created.
- supergroup_chat_created – A supergroup was created.
- channel_chat_created – A channel was created.
- migrate_to_chat_id – Group was upgraded to supergroup.
- migrate_from_chat_id – Supergroup created from a group.
- pinned_message – A message was pinned in the chat.
- invoice – An invoice was sent to the user.
- successful_payment – A payment was successfully completed.
- connected_website – A website connected via Telegram login.
- poll – A poll was sent.
- passport_data – Telegram Passport data was sent.
- proximity_alert_triggered – Nearby user alert triggered.
- video_chat_scheduled – A video chat was scheduled.
- video_chat_started – A video chat started.
- video_chat_ended – A video chat ended.
- video_chat_participants_invited – Participants were invited.
- web_app_data – Data received from a Telegram Web App.
- message_auto_delete_timer_changed – Auto-delete timer updated.
- write_access_allowed – Bot granted permission to write messages.
- user_shared – A user profile was shared.
- chat_shared – A chat was shared with the bot.
- story – A Telegram Story was posted.
- forum_topic_created – A forum topic was created.
- forum_topic_closed – A forum topic was closed.
- forum_topic_reopened – A forum topic was reopened.
- forum_topic_edited – A forum topic was edited.
- general_forum_topic_hidden – The general topic was hidden.
- general_forum_topic_unhidden – The general topic was unhidden.