Skip to content

Commit

Permalink
irc: annotate some newer AbstractBot methods with versionadded
Browse files Browse the repository at this point in the history
  • Loading branch information
dgw committed Nov 11, 2024
1 parent ccafa28 commit bad8860
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions sopel/irc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,12 @@ def __init__(self, settings: Config):
self.backend: AbstractIRCBackend = UninitializedBackend(self)
"""IRC Connection Backend."""
self._connection_registered = threading.Event()
"""Flag stating whether the IRC Connection is registered yet."""
"""Flag stating whether the IRC connection is registered yet."""
self.settings = settings
"""Bot settings."""
"""The bot's settings.
.. versionadded:: 7.0
"""

# internal machinery
self.sending = threading.RLock()
Expand Down Expand Up @@ -136,7 +139,10 @@ def config(self) -> Config:

@property
def capabilities(self) -> Capabilities:
"""Capabilities negotiated with the server."""
"""Capabilities negotiated with the server.
.. versionadded:: 8.0
"""
return self._capabilities

@property
Expand Down Expand Up @@ -201,7 +207,10 @@ def server_capabilities(self) -> dict[str, Optional[str]]:

@property
def isupport(self) -> ISupport:
"""Features advertised by the server."""
"""Features advertised by the server.
.. versionadded:: 7.0
"""
return self._isupport

@property
Expand Down Expand Up @@ -288,6 +297,8 @@ def safe_text_length(self, recipient: str) -> int:
can be sent using ``PRIVMSG`` or ``NOTICE`` by subtracting the size
required by the server to convey the bot's message.
.. versionadded:: 8.0
.. seealso::
This method is useful when sending a message using :meth:`say`,
Expand Down Expand Up @@ -512,13 +523,17 @@ def rebuild_nick(self) -> None:
This method exists to update the casemapping rules for the
:class:`~sopel.tools.identifiers.Identifier` that represents the bot's
nick, e.g. after ISUPPORT info is received.
.. versionadded:: 8.0
"""
self._nick = self.make_identifier(str(self._nick))

def change_current_nick(self, new_nick: str) -> None:
"""Change the current nick without configuration modification.
:param new_nick: new nick to be used by the bot
.. versionadded:: 7.1
"""
if self.backend is None:
raise RuntimeError(ERR_BACKEND_NOT_INITIALIZED)
Expand Down

0 comments on commit bad8860

Please sign in to comment.