enable ac()
This commit is contained in:
parent
55719e289b
commit
6080597580
|
@ -14,6 +14,6 @@ SERVERS = {
|
||||||
|
|
||||||
NICKNAME = 'hbot'
|
NICKNAME = 'hbot'
|
||||||
|
|
||||||
ADMINS=['hedy']
|
ADMINS=['hedy', 'hedyli']
|
||||||
|
|
||||||
NOPING=[]
|
NOPING=[]
|
||||||
|
|
7
main.py
7
main.py
|
@ -76,6 +76,7 @@ class Server(BaseServer):
|
||||||
|
|
||||||
if line.command == "INVITE":
|
if line.command == "INVITE":
|
||||||
await self.send(build("JOIN",[line.params[1]]))
|
await self.send(build("JOIN",[line.params[1]]))
|
||||||
|
# TODO: add to relay chans if needed
|
||||||
self.chans.append(line.params[1])
|
self.chans.append(line.params[1])
|
||||||
|
|
||||||
async def line_send(self, line: Line):
|
async def line_send(self, line: Line):
|
||||||
|
@ -91,11 +92,12 @@ class Server(BaseServer):
|
||||||
await self.send(build("PRIVMSG",[c,f"\x0f\x0f\x0f\x0f<{nick[:1]}\u200c{nick[1:]}@{name}{chan}> {msg}"]))
|
await self.send(build("PRIVMSG",[c,f"\x0f\x0f\x0f\x0f<{nick[:1]}\u200c{nick[1:]}@{name}{chan}> {msg}"]))
|
||||||
|
|
||||||
async def ac(self,name,args):
|
async def ac(self,name,args):
|
||||||
if self.disconnected or "chan" not in list(dir(self)):
|
if self.disconnected or "chans" not in list(dir(self)):
|
||||||
return
|
return
|
||||||
nargs = []
|
nargs = []
|
||||||
isComb = False
|
isComb = False
|
||||||
for arg in args:
|
for arg in args:
|
||||||
|
print("a", arg)
|
||||||
if arg[0] == ':':
|
if arg[0] == ':':
|
||||||
isComb = True
|
isComb = True
|
||||||
nargs.append(arg[1:])
|
nargs.append(arg[1:])
|
||||||
|
@ -104,7 +106,8 @@ class Server(BaseServer):
|
||||||
nargs[-1] += ' '+arg
|
nargs[-1] += ' '+arg
|
||||||
else:
|
else:
|
||||||
nargs.append(arg)
|
nargs.append(arg)
|
||||||
await self.send(build(nargs[0],[self.chan]+nargs[1:]))
|
print("nargs:", nargs)
|
||||||
|
await self.send(build(nargs[0],[self.chans[0]]+nargs[1:])) # TODO: loop over chans
|
||||||
|
|
||||||
class Bot(BaseBot):
|
class Bot(BaseBot):
|
||||||
def create_server(self, name: str):
|
def create_server(self, name: str):
|
||||||
|
|
Loading…
Reference in New Issue