Skip to content

Commit

Permalink
feat: Method for getting a list of users on a CTS
Browse files Browse the repository at this point in the history
  • Loading branch information
nidemidovich committed Oct 28, 2022
1 parent 305a648 commit 120f9c8
Show file tree
Hide file tree
Showing 12 changed files with 589 additions and 206 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
uses: ExpressApp/[email protected]
with:
python-version: ${{ matrix.python-version }}
poetry-version: "1.1.12"
poetry-version: "1.2.1"

- name: Run tests
env:
Expand All @@ -36,6 +36,9 @@ jobs:
steps:
- name: Setup dependencies
uses: ExpressApp/[email protected]
with:
python-version: "3.10"
poetry-version: "1.2.1"

- name: Run linters
run: |
Expand All @@ -48,6 +51,9 @@ jobs:
steps:
- name: Setup dependencies
uses: ExpressApp/[email protected]
with:
python-version: "3.10"
poetry-version: "1.2.1"

- name: Run linters
run: |
Expand Down
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -555,3 +555,24 @@ async def create_group_chat_handler(message: IncomingMessage, bot: Bot) -> None:
chat_mention = MentionBuilder.chat(chat_id)
await bot.answer_message(f"Chat created: {chat_mention}")
```

### Получение списка пользователей
*([подробное описание функции](https://ccsteam.atlassian.net/wiki/spaces/SMARTAPP/pages/311001185/Bot+API+BotX+API#%D0%9F%D0%BE%D0%BB%D1%83%D1%87%D0%B5%D0%BD%D0%B8%D0%B5-%D1%81%D0%BF%D0%B8%D1%81%D0%BA%D0%B0-%D0%BF%D0%BE%D0%BB%D1%8C%D0%B7%D0%BE%D0%B2%D0%B0%D1%82%D0%B5%D0%BB%D0%B5%D0%B9-%D0%BD%D0%B0-CTS))*

```python
from pybotx import *

collector = HandlerCollector()


@collector.command("/get_users_list", description="Get a list of users")
async def users_list_handler(message: IncomingMessage, bot: Bot) -> None:
async with bot.users_as_csv(
bot_id=message.bot.id,
cts_user=True,
unregistered=False,
botx=False,
) as users:
async for user in users:
print(user)
```
Loading

0 comments on commit 120f9c8

Please sign in to comment.