# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

import requests


# ## Testo

# +
def telegram_bot_sendtext(bot_message):
    
    bot_token = '<KEY>'
    bot_chatID = '166942243'
    send_text = 'https://api.telegram.org/bot' + bot_token + '/sendMessage?chat_id=' + bot_chatID + '&parse_mode=Markdown&text=' + bot_message

    response = requests.get(send_text)

    return response.json()
    

test = telegram_bot_sendtext("Paul")
print(test)


# -

# ## Immagini

def sendImage():
    url = "https://api.telegram.org/bot937044171:AAGGDmJcUTkkvDaOwcKrnHUyj9XUND7d52A/sendPhoto";
    files = {'photo': open('image/png', 'rb')}
    data = {'chat_id' : "166942243"}
    r= requests.post(url, files=files, data=data)
    print(r.status_code, r.reason, r.content)

StarcoderdataJupyterScriptsDedupFiltered