将访问权限转移到Telegram频道

huangapple go评论83阅读模式
英文:

Transfer access rights to the Telegram-channel

问题

我需要将访问权限转移到Telegram频道。

我试图使用EditCreatorRequest函数来实现这个目标。但是我无法成功,因为我不明白需要指定哪些参数,特别是我困在了指定密码上。不幸的是,文档中没有明确的示例。感谢大家的帮助。

英文:

I need to transfer access rights to the Telegram-channel.

I'm trying to do this using the EditCreatorRequest function. But it doesn't work out for me, because I don't understand what parameters need to be specified, namely, I'm stuck on specifying a password. Unfortunately, there is no clear example in the documentation. Thank you all for your help.

答案1

得分: 1

使用库内部的函数:

from telethon.password import compute_check
from telethon.tl.functions import account, channels

pass_info = await client(account.GetPasswordRequest())
input_srp = compute_check(
    pass_info, "your_password"
)
await client(
    channels.EditCreatorRequest(
        channel, user,
        password=input_srp
    )
)
英文:

Use the internal function the library uses:

from telethon.password import compute_check
from telethon.tl.functions import account, channels

pass_info = await client(account.GetPasswordRequest())
input_srp = compute_check(
    pass_info, "your_password"
)
await client(
    channels.EditCreatorRequest(
        channel, user,
        password=input_srp
    )
)

huangapple
  • 本文由 发表于 2023年5月28日 20:38:48
  • 转载请务必保留本文链接:https://go.coder-hub.com/76351529.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定