2019-08-12 16:29:01 +00:00
|
|
|
import os
|
|
|
|
from src import IRCBot, ModuleManager, utils
|
|
|
|
|
|
|
|
class Module(ModuleManager.BaseModule):
|
|
|
|
@utils.hook("received.command.version")
|
|
|
|
def version(self, event):
|
2020-02-03 23:00:53 +00:00
|
|
|
commit_hash = utils.git_commit(self.bot.directory)
|
2019-08-12 16:29:01 +00:00
|
|
|
|
|
|
|
out = "Version: BitBot %s" % IRCBot.VERSION
|
|
|
|
if not commit_hash == None:
|
2020-02-03 23:00:53 +00:00
|
|
|
out = "%s (%s@%s)" % (out, branch, commit_hash)
|
2019-08-12 16:29:01 +00:00
|
|
|
event["stdout"].write(out)
|
|
|
|
|
|
|
|
@utils.hook("received.command.source")
|
|
|
|
def source(self, event):
|
|
|
|
event["stdout"].write("Source: %s" % IRCBot.SOURCE)
|