Skip to content

Commit

Permalink
Tiny improvements (#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
wrongnull committed Jun 11, 2023
1 parent d88311a commit 862655a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions vkwave/bots/addons/easy/clones_bot.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import asyncio
import typing
from collections.abc import Iterator

from .easy_userbot import SimpleLongPollUserBot
from .easy_bot import SimpleLongPollBot
Expand All @@ -20,6 +21,12 @@ def __init__(
self.router = self.base_bot.router
self.clones: typing.List[typing.Union[SimpleLongPollUserBot, SimpleLongPollBot]] = list(clones)

def __iter__(self) -> Iterator[typing.Union[SimpleLongPollUserBot, SimpleLongPollBot]]:
return iter(self.clones)

def __len__(self) -> int:
return len(self.clones)

def add_clone(self, clone: typing.Union[SimpleLongPollUserBot, SimpleLongPollBot]) -> None:
self.clones.append(clone)

Expand Down

0 comments on commit 862655a

Please sign in to comment.