[英]TyperError while inserting list into mongodb via python
上面的代碼應該能夠將列表插入 mongodb 但它給出了以下錯誤。 代碼應該如何而不是它是什么。 ...
[英]TyperError while inserting list into mongodb via python
上面的代碼應該能夠將列表插入 mongodb 但它給出了以下錯誤。 代碼應該如何而不是它是什么。 ...
[英]Time range when parsing messages in telegram. Telegram Bot
我正在制作一個 Telegram 機器人,我需要設置一個時間范圍來收集上個月的消息。 ...
[英]How to upload downloaded telegram media directly on google drive?
我正在研究用於下載圖像和視頻的 telethon download_media 方法。 它工作正常(如預期的那樣)。 現在,我想直接將 download_media 上傳到我的 google drive 文件夾。 示例代碼類似於: 此代碼無效。 如何為 download_media 定義 goog ...
[英]Send message from bot to self with telethon
我正在嘗試使用我創建的 Telegram 機器人向自己發送消息,我從https://my.telegram.org以及 BotFather 獲得了值。import telebot from telethon.sync import TelegramClient def telegram_setu ...
[英]How to know whether an username belongs to a group or a user in telegram using python? If yes, get the Group Title
我嘗試過 telethon,但經常受到速率限制/睡眠 function,它花費的時間太長了。 需要可以快速運行且不受速率限制的東西。 ...
[英]How to get message replies from Telegram groups by API - Python
我正在嘗試獲取對頻道中消息的回復。 例如:如果我的帖子在頻道 X(比如 1555671526)中有 60 條回復(應用程序中提到的“討論”),我需要連同原始帖子一起獲取所有這 60 條回復消息。 截至目前,我正在嘗試: 我知道如果沒有回復,get_reply_message 將返回 None 並且在 ...
[英]Telebot and Telethon libraries connection
再會。 我有興趣將電報機器人與 telethon 庫的某些功能相結合(以獲取我選擇的任何聊天的所有用戶),我的代碼使用命令 /send 啟動機器人,然后詢問電話號碼。 向電報帳戶發送請求代碼,然后它應該以該用戶身份登錄並收集對話。 現在它讀取電話並發送代碼,但是,當我輸入從電報收到的代碼並且我的移動 ...
[英]Problem authenticating to the Telegram API non-interactively with Telethon - SMS is sent but the client is not receiving it
我在使用 Telethon 1.26.1 版和 Python 3.10.7 以非交互方式驗證電報 API 時遇到問題我不能使用機器人帳戶,因為我需要訪問消息歷史記錄,所以我嘗試使用下面的代碼通過電話號碼進行身份驗證。 該代碼成功向我的手機發送了一條身份驗證 SMS 消息,但 TelegramClie ...
[英]Telethon gives too much errors like security error(server replied wrong with session id) and Request was unsuccessful 6 time(s)
我在電視節目中從事從電報中抓取數據的工作。 大多數時候,服務器花費太多時間並且不斷出錯,有時返回具有相同代碼的數據。 我不知道是什么問題。 我的代碼看起來像這樣,是問題開始的代碼還是這是什么? 以下是我通常會遇到的錯誤。 和 ...
[英]Unable to save retrieved data into MongoDB - Python
我正在從電報中檢索數據,已成功檢索,但如何將其保存到 MongoDB 中。 collection.insert_many(df)錯誤 ...
[英]''A wait of x seconds is required'' returns by telethon( python library for telegram) how can I get rid of it?
當我嘗試運行通過 API 訪問我的電報帳戶的代碼時,它運行良好,直到出現以下錯誤。 A wait of 4013 seconds is required (caused by ResolveUsernameRequest) 錯誤我的代碼如下: 有什么解決辦法,所以我可以擺脫它嗎? 我應該對我的代碼 ...
[英]How to Add a Menu to a Telegram Bot Using Telethon Library
我創建了一個簡單的電報機器人,它將接受用戶的輸入並執行一些操作並將結果返回給用戶。 但是,我想添加一個菜單,其中基於菜單選項將調用特定的 function 並將結果返回給用戶。 每個操作需要 0 到 60 秒,並且該機器人由多個用戶使用。 我有一些擔憂。 首先,如何確保機器人將在菜單選擇之前存儲輸入 ...
[英]How to use numeric chat IDs to avoid expensive `get_entity(channel_name)` calls?
根據此評論,我正在嘗試在我的電視節目代碼中使用數字頻道 ID,這樣我就不會以昂貴的名稱查找調用向 Telegram API 發送垃圾郵件並受到限制,但我遇到了一些困難。 例如,假設我已經實例化並連接了client : ...失敗並出現此錯誤: 我認為正在進行一些緩存,因為如果我首先使用帳戶名進行 ...
[英]read a direct message when arrival using telegram_api
我正在使用一個應用程序,它需要在電報到達時從電報中讀取直接消息。 我在谷歌上搜索,但我得到的只是如何發送消息,而不是如何閱讀全新的 dms。 謝謝! ...
[英]How to create a fake StringSession for unit tests
我有一些代碼使用 StringSession 通過 telethon 與電報 API 交談。 在我的單元測試中,我試圖實例化一個模擬的 TelegramClient,將 StringSession(myvalue) object 作為第一個參數傳遞給它。 真正的代碼工作正常,但我需要一個假的 se ...
[英]How to get Telegram audio (music) album cover using Telethon API client
我想使用 MTProto API 和Telethon Python lib 獲取電報音頻文檔(音樂)專輯封面的 URL 或字節,但我無法通過檢查音頻消息屬性找到這樣的東西。 消息附加media屬性有一個縮略圖屬性,即thumbs 。 注意:當我使用client.download_media下載媒體時 ...
[英]AttributeError: 'ChatForbidden' object has no attribute 'access_hash'
我用 Python 制作了一個電報會員抓取器和邀請器。它在一些測試中是成功的,但有時我的帳戶會在看到此錯誤消息后被禁止: AttributeError: 'ChatForbidden' object 沒有屬性 'access_hash' 如果我已經是某個群組的管理員,我不確定為什么它會顯示Cha ...
[英]Getting error while using telegram api for data scraping
我的代碼...我在帶有 Telethon 庫的 VS Code 中使用 Python 語言。 下面是我以前得到的結果/錯誤。 我正在嘗試使用 telethon(用於電報的 python 庫)從電報中抓取數據。 ...
[英]How to get telegram chat invite link using telethon?
我正在嘗試獲取公共頻道和公共組的邀請鏈接。 我嘗試使用 ExportChatInviteRequest function 但它引發了 ChatAdminRequiredError。 我不明白的是為什么我可以使用電報應用程序查看並獲取公共頻道\組的邀請鏈接,但不能使用 telethon 獲取它? 我 ...
[英]getting error of database is locked in python, telethon
我正在使用這段代碼: 以上代碼的結果:Traceback (most recent call last): File "/home/khan/Desktop/hello.py", line 23, in <module> with TelegramClient('test' ...