report on the version of dr.botzo in CTCP VERSION

This commit is contained in:
Brian S. Stephan 2023-03-02 00:45:55 -06:00
parent 572ecddceb
commit 4289f95800
Signed by: bss
GPG Key ID: 3DE06D3180895FCB
1 changed files with 4 additions and 4 deletions

View File

@ -20,6 +20,7 @@ from irc.dict import IRCDict
from jaraco.stream import buffer
import ircbot.lib as ircbotlib
from dr_botzo import __version__
from ircbot.models import Alias, IrcChannel, IrcPlugin, IrcServer
log = logging.getLogger('ircbot.bot')
@ -574,12 +575,11 @@ class IRCBot(irc.client.SimpleIRCClient):
self.connection.disconnect(msg)
def get_version(self):
"""Returns the bot version.
"""Return the bot version.
Used when answering a CTCP VERSION request.
"""
return "Python irc.bot ({version})".format(
version=irc.client.VERSION_STRING)
return f"dr.botzo {__version__}"
def jump_server(self, msg="Changing servers"):
"""Connect to a new server, potentially disconnecting from the current one."""
@ -589,7 +589,7 @@ class IRCBot(irc.client.SimpleIRCClient):
self._connect()
def on_ctcp(self, c, e):
"""Default handler for ctcp events.
"""Handle for ctcp events.
Replies to VERSION and PING requests and relays DCC requests
to the on_dccchat method.