RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

Close
  • 主页
  • 系统&网络
    • 热门问题
    • 最新问题
    • 标签
  • Ubuntu
    • 热门问题
    • 最新问题
    • 标签
  • 帮助
主页 / user-402307

leonardo's questions

Martin Hope
leonardo
Asked: 2020-08-24 02:47:06 +0000 UTC

是否可以在内联按钮中创建功能?[关闭]

  • 0
关闭。这个问题需要澄清或补充细节。目前不接受回复。

想改进这个问题?通过编辑此帖子添加更多详细信息并澄清问题。

2年前关闭。

改进问题

问题。是否可以在内联按钮中创建功能?同时,它会实现。电报机器人。电报机器人 ip 库。

python
  • 1 个回答
  • 10 Views
Martin Hope
leonardo
Asked: 2020-08-23 20:21:49 +0000 UTC

如何使它在文本中。调用时,写了按下按钮的用户名

  • -1

学习在按钮中制作后退键。如何使它在调用时在文本中写入单击按钮的用户的名称?

bot.edit_message_text(
    chat_id=call.message.chat.id, message_id=call.message.message_id,
    text=("Привіт " + call.message.message_id.from_user.first_name +
          "🥰!" +
          "\n Я допоможу тобі роз  рахувати твій конкурсний бал 🎲 ... "),
    reply_markup=keyboardg)

编码

@bot.callback_query_handler(func=lambda call: True)
def callback_inline(call):
    if call.data == "mainmenu":
        keyboardg = types.InlineKeyboardMarkup(row_width=1)

        callback_button = types.InlineKeyboardButton(
            text="Так ✔ ️💯", callback_data="test")

        callback_button_1 = types.InlineKeyboardButton(
            text="Ні ❌ ", callback_data="test_1")

        keyboardg.add(callback_button, callback_button_1)

        bot.edit_message_text(
            chat_id=call.message.chat.id, message_id=call.message.message_id,
            text=("Привіт " + call.message.message_id.from_user.first_name +
                  "🥰!" +
                  "\n Я допоможу тобі роз  рахувати твій конкурсний бал 🎲 ... "),
            reply_markup=keyboardg)
python
  • 1 个回答
  • 10 Views
Martin Hope
leonardo
Asked: 2020-08-12 20:26:21 +0000 UTC

如何解决 eric matiz python 类的问题

  • 0

我从一本自学书上学习编程,我用一堂课解决了一个问题。

餐厅:创建一个名为Restaurant. 类方法必须包含两个属性__init__():和。创建一个输出两个属性的方法,以及一个显示餐厅营业消息的方法。从您的类中创建一个名为. 分别打印这两个属性,然后调用这两个方法。Restaurantrestaurant_namecuisine_typedescribe_restaurant()open_restaurant()restaurant

我的示例代码:

class Restaurant():
    
 def _init_(self, name, tip):
   self.name = name
   self.tip = tip
   
 def describe_restaurant():
     print("Hello, visitor!" + self.name.title() + "welcome to you!")
 def open_restaurant():
     print("It is" + self.tip)

my_restaurant = ['natalia' , 'ukrainian']
print("Hello, visitor!")
print(describe_restaurant())
python
  • 3 个回答
  • 10 Views
Martin Hope
leonardo
Asked: 2020-08-10 18:37:27 +0000 UTC

函数 SyntaxError 中的错误:语法无效

  • -2

初学者编写代码,编写 2 个函数。请看并告诉我我编写的函数的替代方案以及错误是什么。不要严格判断。编码

def user_spisok(name, age):
 for names in name:
        print("\nHello,"+ name.title())
print("\ How are old you ? ")
for ages in age :
 print(ages)
spisok ['eva', age = 13]

错误代码。

user_spisok(spisok)
 File "user.py", line 7
    spisok ['eva', age = 13]
                       ^
SyntaxError: invalid syntax
python
  • 1 个回答
  • 10 Views
Martin Hope
leonardo
Asked: 2020-08-09 18:35:35 +0000 UTC

pycharm不运行pyTelegramBotAPI库,是不是写了和服务没有连接?

  • 0

Python 世界的新手。我为电报机器人编写了代码。我在pycharm中运行它,它说没有连接到服务器。Pycharm 已安装 pip,即 yTelegramBotAPI 库。不要严格判断。我不明白出了什么问题。pip 和 yTelegramBotAPI 库已安装新版本检查。代码:bot = telebot.TeleBot(')

@bot.message_handler(content_types=['text']) def get_text_messages(message): if message.text == "Hello":

    bot.send_message(message.from_user.id, "Привет, сейчас я расскажу тебе гороскоп на сегодня.")

elif message.text == "/help":

    bot.send_message(message.from_user.id, "Напиши Привет")

else:

    bot.send_message(message.from_user.id, "Я тебя не понимаю. Напиши /help.")

bot.polling(none_stop=True, interval=0) 我知道代码一切正常。错误 :

2020-08-09 13:07:59,135 (util.py:68 PollingThread) ERROR - TeleBot: "ApiException occurred, args=('A request to the Telegram API was unsuccessful. The server returned HTTP 409 Conflict. Response body:\n[b\'{"ok":false,"error_code":409,"description":"Conflict: can\\\'t use getUpdates method while webhook is active; use deleteWebhook to delete the webhook first"}\']',)
Traceback (most recent call last):
File "D:\Soft\python\lib\site-packages\telebot\util.py", line 62, in run
task(*args, **kwargs)
File "D:\Soft\python\lib\site-packages\telebot\__init__.py", line 285, in __retrieve_updates
updates = self.get_updates(offset=(self.last_update_id + 1), timeout=timeout)
File "D:\Soft\python\lib\site-packages\telebot\__init__.py", line 255, in get_updates
json_updates = apihelper.get_updates(self.token, offset, limit, timeout, allowed_updates)
File "D:\Soft\python\lib\site-packages\telebot\apihelper.py", line 206, in get_updates
return _make_request(token, method_url, params=payload)
File "D:\Soft\python\lib\site-packages\telebot\apihelper.py", line 69, in _make_request
return _check_result(method_name, result)['result']
File "D:\Soft\python\lib\site-packages\telebot\apihelper.py", line 88, in _check_result
raise ApiException(msg, method_name, result)
telebot.apihelper.ApiException: A request to the Telegram API was unsuccessful. The server returned HTTP 409 Conflict. Response body:
[b'{"ok":false,"error_code":409,"description":"Conflict: can\'t use getUpdates method while webhook is active; use deleteWebhook to delete the webhook first"}']
"
2020-08-09 13:07:59,136 (__init__.py:455 MainThread) ERROR - TeleBot: "A request to the Telegram API was unsuccessful. The server returned HTTP 409 Conflict. Response body:
[b'{"ok":false,"error_code":409,"description":"Conflict: can\'t use getUpdates method while webhook is active; use deleteWebhook to delete the webhook first"}']"
2020-08-09 13:08:02,529 (util.py:68 PollingThread) ERROR - TeleBot: "ApiException occurred, args=('A request to the Telegram API was unsuccessful. The server returned HTTP 409 Conflict. Response body:\n[b\'{"ok":false,"error_code":409,"description":"Conflict: can\\\'t use getUpdates method while webhook is active; use deleteWebhook to delete the webhook first"}\']',)
Traceback (most recent call last):
File "D:\Soft\python\lib\site-packages\telebot\util.py", line 62, in run
task(*args, **kwargs)
File "D:\Soft\python\lib\site-packages\telebot\__init__.py", line 285, in __retrieve_updates
updates = self.get_updates(offset=(self.last_update_id + 1), timeout=timeout)
File "D:\Soft\python\lib\site-packages\telebot\__init__.py", line 255, in get_updates
json_updates = apihelper.get_updates(self.token, offset, limit, timeout, allowed_updates)
File "D:\Soft\python\lib\site-packages\telebot\apihelper.py", line 206, in get_updates
return _make_request(token, method_url, params=payload)
File "D:\Soft\python\lib\site-packages\telebot\apihelper.py", line 69, in _make_request
return _check_result(method_name, result)['result']
2020-08-09 13:08:02,530 (__init__.py:455 MainThread) ERROR - TeleBot: "A request to the Telegram API was unsuccessful. The server returned HTTP 409 Conflict. Response body:
[b'{"ok":false,"error_code":409,"description":"Conflict: can\'t use getUpdates method while webhook is active; use deleteWebhook to delete the webhook first"}']"
2020-08-09 13:08:03,140 (util.py:68 PollingThread) ERROR - TeleBot: "ApiException occurred, args=('A request to the Telegram API was unsuccessful. The server returned HTTP 409 Conflict. Response body:\n[b\'{"ok":false,"error_code":409,"description":"Conflict: can\\\'t use getUpdates method while webhook is active; use deleteWebhook to delete the webhook first"}\']',)
Traceback (most recent call last):
File "D:\Soft\python\lib\site-packages\telebot\util.py", line 62, in run
task(*args, **kwargs)
File "D:\Soft\python\lib\site-packages\telebot\__init__.py", line 285, in __retrieve_updates
updates = self.get_updates(offset=(self.last_update_id + 1), timeout=timeout)
File "D:\Soft\python\lib\site-packages\telebot\__init__.py", line 255, in get_updates
json_updates = apihelper.get_updates(self.token, offset, limit, timeout, allowed_updates)
File "D:\Soft\python\lib\site-packages\telebot\apihelper.py", line 206, in get_updates
return _make_request(token, method_url, params=payload)
File "D:\Soft\python\lib\site-packages\telebot\apihelper.py", line 69, in _make_request
return _check_result(method_name, result)['result']
File "D:\Soft\python\lib\site-packages\telebot\apihelper.py", line 88, in _check_result
raise ApiException(msg, method_name, result)
telebot.apihelper.ApiException: A request to the Telegram API was unsuccessful. The server returned HTTP 409 Conflict. Response body:
[b'{"ok":false,"error_code":409,"description":"Conflict: can\'t use getUpdates method while webhook is active; use deleteWebhook to delete the webhook first"}']
2020-08-09 13:08:09,413 (__init__.py:455 MainThread) ERROR - TeleBot: "A request to the Telegram API was unsuccessful. The server returned HTTP 409 Conflict. Response body:
[b'{"ok":false,"error_code":409,"description":"Conflict: can\'t use getUpdates method while webhook is active; use deleteWebhook to delete the webhook first"}']"
2020-08-09 13:08:13,531 (util.py:68 PollingThread) ERROR - TeleBot: "ApiException occurred, args=('A request to the Telegram API was unsuccessful. The server returned HTTP 409 Conflict. Response body:\n[b\'{"ok":false,"error_code":409,"description":"Conflict: can\\\'t use getUpdates method while webhook is active; use deleteWebhook to delete the webhook first"}\']',)
Traceback (most recent call last):
File "D:\Soft\python\lib\site-packages\telebot\util.py", line 62, in run
task(*args, **kwargs)
File "D:\Soft\python\lib\site-packages\telebot\__init__.py", line 285, in __retrieve_updates
updates = self.get_updates(offset=(self.last_update_id + 1), timeout=timeout)
File "D:\Soft\python\lib\site-packages\telebot\__init__.py", line 255, in get_updates
json_updates = apihelper.get_updates(self.token, offset, limit, timeout, allowed_updates)
File "D:\Soft\python\lib\site-packages\telebot\apihelper.py", line 206, in get_updates
return _make_request(token, method_url, params=payload)
File "D:\Soft\python\lib\site-packages\telebot\apihelper.py", line 69, in _make_request
return _check_result(method_name, result)['result']
File "D:\Soft\python\lib\site-packages\telebot\apihelper.py", line 88, in _check_result
raise ApiException(msg, method_name, result)
telebot.apihelper.ApiException: A request to the Telegram API was unsuccessful. The server returned HTTP 409 Conflict. Response body:
[b'{"ok":false,"error_code":409,"description":"Conflict: can\'t use getUpdates method while webhook is active; use deleteWebhook to delete the webhook first"}']
"
2020-08-09 13:16:38,243 (__init__.py:455 MainThread) ERROR - TeleBot: "A request to the Telegram API was unsuccessful. The server returned HTTP 409 Conflict. Response body:
[b'{"ok":false,"error_code":409,"description":"Conflict: can\'t use getUpdates method while webhook is active; use deleteWebhook to delete the webhook first"}']"
pycharm
  • 1 个回答
  • 10 Views

Sidebar

Stats

  • 问题 10021
  • Answers 30001
  • 最佳答案 8000
  • 用户 6900
  • 常问
  • 回答
  • Marko Smith

    我看不懂措辞

    • 1 个回答
  • Marko Smith

    请求的模块“del”不提供名为“default”的导出

    • 3 个回答
  • Marko Smith

    "!+tab" 在 HTML 的 vs 代码中不起作用

    • 5 个回答
  • Marko Smith

    我正在尝试解决“猜词”的问题。Python

    • 2 个回答
  • Marko Smith

    可以使用哪些命令将当前指针移动到指定的提交而不更改工作目录中的文件?

    • 1 个回答
  • Marko Smith

    Python解析野莓

    • 1 个回答
  • Marko Smith

    问题:“警告:检查最新版本的 pip 时出错。”

    • 2 个回答
  • Marko Smith

    帮助编写一个用值填充变量的循环。解决这个问题

    • 2 个回答
  • Marko Smith

    尽管依赖数组为空,但在渲染上调用了 2 次 useEffect

    • 2 个回答
  • Marko Smith

    数据不通过 Telegram.WebApp.sendData 发送

    • 1 个回答
  • Martin Hope
    Alexandr_TT 2020年新年大赛! 2020-12-20 18:20:21 +0000 UTC
  • Martin Hope
    Alexandr_TT 圣诞树动画 2020-12-23 00:38:08 +0000 UTC
  • Martin Hope
    Air 究竟是什么标识了网站访问者? 2020-11-03 15:49:20 +0000 UTC
  • Martin Hope
    Qwertiy 号码显示 9223372036854775807 2020-07-11 18:16:49 +0000 UTC
  • Martin Hope
    user216109 如何为黑客设下陷阱,或充分击退攻击? 2020-05-10 02:22:52 +0000 UTC
  • Martin Hope
    Qwertiy 并变成3个无穷大 2020-11-06 07:15:57 +0000 UTC
  • Martin Hope
    koks_rs 什么是样板代码? 2020-10-27 15:43:19 +0000 UTC
  • Martin Hope
    Sirop4ik 向 git 提交发布的正确方法是什么? 2020-10-05 00:02:00 +0000 UTC
  • Martin Hope
    faoxis 为什么在这么多示例中函数都称为 foo? 2020-08-15 04:42:49 +0000 UTC
  • Martin Hope
    Pavel Mayorov 如何从事件或回调函数中返回值?或者至少等他们完成。 2020-08-11 16:49:28 +0000 UTC

热门标签

javascript python java php c# c++ html android jquery mysql

Explore

  • 主页
  • 问题
    • 热门问题
    • 最新问题
  • 标签
  • 帮助

Footer

RError.com

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

帮助

© 2023 RError.com All Rights Reserve   沪ICP备12040472号-5