我需要导入(从 pyrogram.types 导入消息)但是我应该给“消息”什么值?据我所知,我应该给它“message_id”,但我不知道如何获取它,
import asyncio
import os
from datetime import datetime
import ffmpeg
import pyrogram
import pytgcalls
from pyrogram import Client, filters
from pyrogram.types import Message
from pytgcalls import GroupCallFactory, GroupCallFileAction, GroupCall
GROUP_CALL = None
SECONDS_TO_RECORD = 120
CLIENT_TYPE = pytgcalls.GroupCallFactory.MTPROTO_CLIENT_TYPE.PYROGRAM
API_HASH = ""
API_ID =
Proxy = dict(
hostname="",
port=
)
pyro_client = pyrogram.Client(
os.environ.get('SESSION_NAME', 'pytgcalls'),
api_hash=os.environ.get('API_HASH', API_HASH),
api_id=os.environ.get('API_ID', API_ID),
)
client_message = Message(client=pyro_client,message_id=???)
@Client.on_message(
filters.group & filters.text & filters.outgoing & ~filters.edited & filters.command('record', prefixes='!')
)
async def record_from_voice_chat(client: Client, m: Message):
global GROUP_CALL
if not GROUP_CALL:
GROUP_CALL = GroupCallFactory(client,CLIENT_TYPE ,path_to_log_file='c:/users').get_file_group_call()
GROUP_CALL.add_handler(network_status_changed_handler, GroupCallFileAction.NETWORK_STATUS_CHANGED)
await GROUP_CALL.start(m.chat.id)
await m.delete()