Compare commits

...

2 Commits

Author SHA1 Message Date
xfnw 978d1b8231 remove extra newline 2021-10-05 00:40:39 -04:00
xfnw 2179c2770a backport automatic module name detection 2021-09-27 15:52:16 -04:00
3 changed files with 4 additions and 4 deletions

5
bot.py
View File

@ -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}']))

View File

@ -66,7 +66,6 @@ async def genOut(self, noun):
coun += 1
iter = 0
while (end.find_one(word=out[-1]) is None or nouns.count(word=out[-1])-1 > iter * shared.enmul) and iter < 7:
try:
out.append(random.choice(list(prew.find(pre=out[-1])))['pro'])
except IndexError:

View File

@ -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')