Skip to content

Commit

Permalink
tokens to pool
Browse files Browse the repository at this point in the history
  • Loading branch information
kesha1225 committed Apr 9, 2020
1 parent b634b9b commit ae0b21c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/bots/clones_bot_example.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
create many bots with same functionality
create many bots with the same functionality
"""

from vkwave.bots.easy import SimpleLongPollGroupBot, TaskManager, ClonesBot
Expand Down
6 changes: 3 additions & 3 deletions vkwave/bots/easy/easy_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import typing

from vkwave.api.methods import API
from vkwave.api.token.token import BotSyncSingleToken, Token
from vkwave.api.token.token import BotSyncSingleToken, Token, BotSyncPoolTokens
from vkwave.bots.core import BaseFilter
from vkwave.bots.core.dispatching.dp.dp import Dispatcher
from vkwave.bots.core.dispatching.events.base import BaseEvent, BotEvent
Expand Down Expand Up @@ -31,7 +31,7 @@ def __init__(self, tokens: typing.Union[str, typing.List[str]]):
self.tokens = (
BotSyncSingleToken(Token(tokens))
if isinstance(tokens, str)
else [BotSyncSingleToken(Token(token)) for token in tokens]
else BotSyncPoolTokens([Token(token) for token in tokens])
)
self.api = API(clients=self.client, tokens=self.tokens)

Expand Down Expand Up @@ -142,7 +142,7 @@ def run_forever(self, loop: typing.Optional[asyncio.AbstractEventLoop] = None):

class ClonesBot:
"""
Create many bots with same functionality
Create many bots with the same functionality
"""

def __init__(self, base_bot: SimpleLongPollGroupBot, *clones: SimpleLongPollGroupBot):
Expand Down

0 comments on commit ae0b21c

Please sign in to comment.