私は本当に混乱しているので、戻ってみましょう。このコードで
私はチャットユーザーからの最後のメッセージを取得し、私のボットに転送しよう:
def callback(update):
source_chat_id = "here i put the user id"
source_hash = "here i put his access_hash"
source_chat = InputPeerUser(source_chat_id, source_hash)
total_count, messages, senders = client.get_message_history(
source_chat, limit=10)
for msg in reversed(messages):
print ("msg:", msg.id, msg)
msg = messages[0]
print ("msg id:", msg.id)
dest_chat = "here i tried to put the number of my bot ID"
result = client.invoke(ForwardMessagesRequest(from_peer=source_chat, id=[msg.id], random_id=[generate_random_long()], to_peer=dest_chat))
client.add_update_handler(callback)
プリントが正しかったが、私は私のボットチャットには何も受信しませんでした。 私は多くの間違いがあることを知っているので、辛抱強くごめんなさい。
あなたが試したことと失敗した方法を教えてもらえますか? – KyrSt