#๐ Making a simple Telegram bot using Python
14 messages ยท Page 1 of 1 (latest)
@unreal finch
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
i started on my own and set the bot up already
i didn't really find any streamlined guides on how to do what i wanted to do so i just kinda did it randomly
import os
import telebot
bot = telebot.TeleBot(token)
yt = "C:/Users/39348/Desktop/rip/yt-dlp -o video.mp4"
video = 'video.mp4'
@bot.message_handler(func=lambda msg: True)
def check(message):
os.system(yt + " " + message.text)
bot.infinity_polling()
the token is censored for obv reasons
the download part works when i send it a link
what i don't know how to do is send the video back
i tried bot.send_video but it gives me errors
bot.send_video(chat_id=message.chat.id, video=video)
the idea is that since it's a one time use bot it will always overwrite the last video and send the new one
(disclaimer idk how to use python but i do know js)
everything here was taken from random articles
@unreal finch
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.