report on the version of dr.botzo in CTCP VERSION
This commit is contained in:
parent
572ecddceb
commit
4289f95800
|
@ -20,6 +20,7 @@ from irc.dict import IRCDict
|
||||||
from jaraco.stream import buffer
|
from jaraco.stream import buffer
|
||||||
|
|
||||||
import ircbot.lib as ircbotlib
|
import ircbot.lib as ircbotlib
|
||||||
|
from dr_botzo import __version__
|
||||||
from ircbot.models import Alias, IrcChannel, IrcPlugin, IrcServer
|
from ircbot.models import Alias, IrcChannel, IrcPlugin, IrcServer
|
||||||
|
|
||||||
log = logging.getLogger('ircbot.bot')
|
log = logging.getLogger('ircbot.bot')
|
||||||
|
@ -574,12 +575,11 @@ class IRCBot(irc.client.SimpleIRCClient):
|
||||||
self.connection.disconnect(msg)
|
self.connection.disconnect(msg)
|
||||||
|
|
||||||
def get_version(self):
|
def get_version(self):
|
||||||
"""Returns the bot version.
|
"""Return the bot version.
|
||||||
|
|
||||||
Used when answering a CTCP VERSION request.
|
Used when answering a CTCP VERSION request.
|
||||||
"""
|
"""
|
||||||
return "Python irc.bot ({version})".format(
|
return f"dr.botzo {__version__}"
|
||||||
version=irc.client.VERSION_STRING)
|
|
||||||
|
|
||||||
def jump_server(self, msg="Changing servers"):
|
def jump_server(self, msg="Changing servers"):
|
||||||
"""Connect to a new server, potentially disconnecting from the current one."""
|
"""Connect to a new server, potentially disconnecting from the current one."""
|
||||||
|
@ -589,7 +589,7 @@ class IRCBot(irc.client.SimpleIRCClient):
|
||||||
self._connect()
|
self._connect()
|
||||||
|
|
||||||
def on_ctcp(self, c, e):
|
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
|
Replies to VERSION and PING requests and relays DCC requests
|
||||||
to the on_dccchat method.
|
to the on_dccchat method.
|
||||||
|
|
Loading…
Reference in New Issue