Compare commits

...

3 Commits

Author SHA1 Message Date
vulpine e6651438e7 dont ping people with the same nicks as their ident 2020-08-04 18:36:28 -04:00
vulpine 808cb03e91 fix more bug 2020-08-04 18:13:32 -04:00
vulpine e184142bed maskfind 2020-08-04 18:09:59 -04:00
2 changed files with 27 additions and 2 deletions

View File

@ -13,8 +13,8 @@ async def more(self, c, n, m):
if c in self.more:
moretext = self.more.pop(c)
if len(moretext) > 300:
self.more[c]=moretext[:250]
moretext = moretext[250:]+' (more)'
self.more[c]=moretext[250:]
moretext = moretext[:250]+' (more)'
await self.message(c, '[\x036help\x0f] '+moretext)
return

View File

@ -16,6 +16,29 @@ async def on_all(self,wtime=100):
self.userdb.insert_ignore(dict(user),['id'])
print('done')
async def maskfind(self,c,n,m):
host = nick = ident = '%'
m = m.strip().replace("*","%").split('@')
host = m.pop()
if len(m) > 0:
ni = m.pop().split('!')
ident = ni.pop()
if len(ni) > 0:
nick = ni.pop()
alts = ["{}!{}@{}".format(i['nickname'],i['username'][:1]+"\u200c"+i['username'][1:],i['hostname']) for i in self.userdb.find(hostname={'like':host},username={'like':ident},nickname={'like':nick})]
falt=' '.join([i[:1]+'\u200c'+i[1:] for i in sorted(list(set(alts)))])
if len(falt) > 250:
self.more[c] = falt[200:]
falt = falt[:200]+' (more)'
await self.message(c,'[\x036usrinfo\x0f] masks: {}'.format(falt))
async def findalt(self,c,n,m):
m = m.strip()
user = self.userdb.find_one(nickname={'like':m},order_by='-id')
@ -45,3 +68,5 @@ async def init(self):
self.help['findalt'] = ['findalt <nick> - find out who someone\'s alts are',';p']
self.cmd['findalt'] = findalt
self.help['maskfind'] = ['maskfind <mask> - search masks','OW']
self.cmd['maskfind'] = maskfind