Skip to content

christhenoob13/telebot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Telebot

basta autobot 'to sa telegram

example echo command:

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

callback query:

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")

Reply Message:

def testCommand(bot, data):
  # method 1
  bot.send_message(data.chat.id, "My reply")
  
  # method 2
  data.reply("My reply")

Official Documentation:

LINK: Telebot Documentation

Documentation

event types

di ko alam ilalagay ko, basta sa event types 'to.

📩 Basic Content Types

  • 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).

🎮 Interactive & Entertainment

  • game – Telegram HTML5 games.
  • sticker – Static or animated Telegram stickers.
  • dice – Random dice roll (🎲, 🎯, etc.).

📍 Location & Contact

  • location – Shared GPS location.
  • contact – Shared contact information.
  • venue – Shared location with name and address.

👥 Chat Member Events

  • new_chat_members – New member(s) joined the group.
  • left_chat_member – A member left or was removed.

🛠 Chat Meta Changes

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

💸 Payments

  • invoice – An invoice was sent to the user.
  • successful_payment – A payment was successfully completed.
  • connected_website – A website connected via Telegram login.

📊 Polls & Feedback

  • poll – A poll was sent.
  • passport_data – Telegram Passport data was sent.
  • proximity_alert_triggered – Nearby user alert triggered.

🎥 Video Chat

  • 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 & Miscellaneous

  • 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 Topics

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors