电报聊天机器人无法发送发票

时间:2020-04-06 07:44:23

标签: python telegram-bot python-telegram-bot

我的问题是sendInvoice HTTP get。 基本上,当我发出URL请求时,Telegram上没有任何显示,也没有在日志或控制台中收到任何类型的错误。

所以我不知道为什么它不起作用。

这是代码(出于隐私原因,我放置了伪造的令牌和chat_id):

def __init__(self, config):
    self.token = "2880000618:AlnCmb0R9YNaR2xxxxxxxxxnixb6jnQYjNJ"
    self.base = "https://api.telegram.org/bot{}/".format(self.token)

def sendInvoice(self, chat_id, title, description, payload, provider_token, start_parameter, currency, prices):
    url = self.base + "sendInvoice?chat_id={}&title={}&description={}&payload={}&provider_token={}&start_parameter={}&currency={}&prices={}".format(chat_id, title, description, payload, provider_token, start_parameter, currency, prices)
    requests.get(url)

def someFunction():
    chat_id = 192837465
    prices = [{
        'label': "Donation",
        'amount': 500
        }]
    sendInvoice(chat_id, "Donation", "Donation of 5 eur", "12345", "500000468:TEST:zczMxxxxxViNjA2N", "pay", "EUR", prices);

预先感谢您的帮助。

0 个答案:

没有答案