mirror of
https://github.com/TeamPGM/PagerMaid_Plugins.git
synced 2024-11-22 00:35:36 +00:00
✨ listusernames 列出所有属于自己的公开群组/频道
This commit is contained in:
parent
04f94ca8e9
commit
c0cb54653f
10
list.json
10
list.json
@ -559,6 +559,16 @@
|
||||
"supported": true,
|
||||
"des-short": "图片转贴纸",
|
||||
"des": "把别人发的图片转换成贴纸(只支持静态)。命令:pic2sticker 。"
|
||||
},
|
||||
{
|
||||
"name": "listusernames",
|
||||
"version": "1.0",
|
||||
"section": "daily",
|
||||
"maintainer": "xtaodada",
|
||||
"size": "0.7 kb",
|
||||
"supported": true,
|
||||
"des-short": "列出所有属于自己的公开群组/频道。",
|
||||
"des": "列出所有属于自己的公开群组/频道。命令:listusernames 。"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
17
listusernames.py
Normal file
17
listusernames.py
Normal file
@ -0,0 +1,17 @@
|
||||
from pagermaid import bot
|
||||
from pagermaid.listener import listener
|
||||
from pagermaid.utils import alias_command
|
||||
from telethon.tl.functions.channels import GetAdminedPublicChannelsRequest
|
||||
|
||||
|
||||
@listener(is_plugin=False, outgoing=True, command=alias_command("listusernames"),
|
||||
description='列出所有属于自己的公开群组/频道。',
|
||||
parameters="")
|
||||
async def listusernames(context):
|
||||
""" Get a list of your reserved usernames. """
|
||||
await context.edit('正在获取中...')
|
||||
result = await bot(GetAdminedPublicChannelsRequest())
|
||||
output = "以下是属于我的所有公开群组/频道:\n\n"
|
||||
for i in result.chats:
|
||||
output += f"{i.title}\n@{i.username}\n\n"
|
||||
await context.edit(output)
|
Loading…
Reference in New Issue
Block a user