Skip to content

Commit

Permalink
🚧 Se realiza prueba con ruta de documento2
Browse files Browse the repository at this point in the history
  • Loading branch information
KrlitosForever committed Mar 25, 2024
1 parent 57dc7c0 commit eb0d5f7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions botExample.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def mensaje(message):
@bot.message_handler(commands=["document"])
def documento(message):
try:
ruta_documento = keys.PATH_AUDIO
ruta_documento = keys.PATH_DOCUMENT
with open(ruta_documento, "rb") as documento:
bot.send_document(message, documento)
bot.send_message(message.chat.id, "Función realizada con éxito✅🎉🥳")
Expand All @@ -94,7 +94,7 @@ def contacto(message):
def audio(message):
try:
# Ruta del archivo de audio en formato M4A que deseas enviar
audio_path = "audio.m4a"
audio_path = keys.PATH_AUDIO

# Enviar el archivo de audio en formato M4A
bot.send_audio(message.chat.id, open(audio_path, "rb"))
Expand Down Expand Up @@ -122,7 +122,7 @@ def location(message):
def imagen(message):
try:
ruta_imagen = "image.jpg"
with open(ruta_imagen, "rb") as imagen:
with open(keys.PATH_IMAGE, "rb") as imagen:
bot.send_photo(message, imagen)
bot.send_message(message.chat.id, "Función realizada con éxito✅🎉🥳")
except Exception as e:
Expand All @@ -134,7 +134,7 @@ def imagen(message):
@bot.message_handler(commands=["video"])
def video(message):
try:
video_ruta = "video.mp4"
video_ruta = "../video.mp4"

bot.send_video(message.chat.id, open(video_ruta, "rb"))
except Exception as e:
Expand Down

0 comments on commit eb0d5f7

Please sign in to comment.