mirror of
https://github.com/MuRuLOSE/limoka.git
synced 2026-06-18 15:14:18 +02:00
Commited backup
This commit is contained in:
21
Fl1yd/FTG-Modules/ownerships.py
Normal file
21
Fl1yd/FTG-Modules/ownerships.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from .. import loader
|
||||
from telethon.tl.functions.channels import GetAdminedPublicChannelsRequest
|
||||
|
||||
|
||||
def register(cb):
|
||||
cb(OwnershipsMod())
|
||||
|
||||
class OwnershipsMod(loader.Module):
|
||||
"""Посмотреть свои владения."""
|
||||
strings = {'name': 'Ownerships'}
|
||||
|
||||
async def owncmd(self, message):
|
||||
"""Команда .own выводит список владений открытых чатов/каналов. """
|
||||
await message.edit('<b>Считаем...</b>')
|
||||
result = await message.client(GetAdminedPublicChannelsRequest())
|
||||
msg = ""
|
||||
count = 0
|
||||
for obj in result.chats:
|
||||
count += 1
|
||||
msg += f'\n• <a href="tg://resolve?domain={obj.username}">{obj.title}</a> <b>|</b> <code>{obj.id}</code>'
|
||||
await message.edit(f'<b>Мои владения: {count}</b>\n {msg}')
|
||||
Reference in New Issue
Block a user