Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/344.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 电报聊天机器人可以';不要寄发票_Python_Telegram Bot_Python Telegram Bot - Fatal编程技术网

Python 电报聊天机器人可以';不要寄发票

Python 电报聊天机器人可以';不要寄发票,python,telegram-bot,python-telegram-bot,Python,Telegram Bot,Python Telegram Bot,我的问题是sendInvoice HTTP get。 基本上,当我发出URL请求时,电报上不会显示任何内容,也不会在日志或控制台中收到任何类型的错误 所以我不知道为什么它不起作用 以下是代码(出于隐私原因,我放置了假令牌和聊天室id): 提前感谢你的帮助 def __init__(self, config): self.token = "2880000618:AlnCmb0R9YNaR2xxxxxxxxxnixb6jnQYjNJ" self.base = "https://api

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

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

以下是代码(出于隐私原因,我放置了假令牌和聊天室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);