Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added test_dc support #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions dumbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,9 @@ class Bot:

timeout (`int`):
The timeout, in seconds, to use when fetching updates.

test_mode (`bool`):
Use bot in test DC
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could use a longer explanation. What is the test DC? How do I create the bot there? How do I interact with it? Also please add a period at the end of the sentence.

Copy link
Author

@CustomIcon CustomIcon Apr 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh thanks for the reply lomi, ill add a longer detailed explanation today in the doc string


loop (`asyncio.AbstractEventLoop`, optional):
The asyncio event loop to use, or the default.
Expand All @@ -305,8 +308,8 @@ class Bot:
the default value of 4 is reasonable too.
"""
def __init__(self, token, *, timeout=10,
loop=None, sequential=False, max_connections=4):
self._post = f'POST /bot{token}/'.encode('ascii')
loop=None, sequential=False, max_connections=4, test_mode=False):
self._post = f'POST /bot{token}/{"test/" if test_mode else ""}'.encode('ascii')
self._timeout = timeout
self._last_update = 0
self._sequential = sequential
Expand Down