diff --git a/bot.py b/bot.py index 1ab0f7b..c6d87e0 100755 --- a/bot.py +++ b/bot.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -import asyncio, os, importlib +import asyncio, os, importlib, inspect from irctokens import build, Line from ircrobots import Bot as BaseBot @@ -41,7 +41,8 @@ def rawm(rname): -async def message(self,modname,channel,msg): +async def message(self,channel,msg): + modname = os.path.splittext(os.path.basename(inspect.stack()[1].filename))[0] await self.send(build("PRIVMSG",[channel,f'[\x036{modname}\x0f] {msg}'])) diff --git a/modules/test.py b/modules/test.py index 187911c..90ae106 100644 --- a/modules/test.py +++ b/modules/test.py @@ -5,7 +5,7 @@ import bot @bot.command('test') @bot.is_admin async def testy(self,channel,nick,msg): - await bot.message(self,'test',channel,'hi there') + await bot.message(self,channel,'hi there')