Update __init__.py
This commit is contained in:
parent
a0344ef497
commit
759a3c0148
1 changed files with 11 additions and 0 deletions
|
@ -67,6 +67,17 @@ class IRCSession: # Actual IRC session
|
||||||
def join(self, chan):
|
def join(self, chan):
|
||||||
self.chans.append(Channel(chan))
|
self.chans.append(Channel(chan))
|
||||||
self.send(f"JOIN {chan}")
|
self.send(f"JOIN {chan}")
|
||||||
|
def part(self, chan:str, message:str="ScParseIRC v"+str(__version__)):
|
||||||
|
complete = False
|
||||||
|
for i in self.chans:
|
||||||
|
if i.name == chan:
|
||||||
|
i.in_channel = False
|
||||||
|
complete = True
|
||||||
|
break
|
||||||
|
if complete:
|
||||||
|
self.send(f"PART {chan}")
|
||||||
|
def privmsg(self, target:str, content:str):
|
||||||
|
self.send(f"PRIVMSG {target} :{content}")
|
||||||
def close(self):
|
def close(self):
|
||||||
if self.ssl:
|
if self.ssl:
|
||||||
self.wsocket.close()
|
self.wsocket.close()
|
||||||
|
|
Loading…
Add table
Reference in a new issue