-
-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
13 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
# This program is free without restrictions; do anything you like with | ||
# it. | ||
# IMPORTANT: sasl_login must equal your nickserv account name | ||
# | ||
# | ||
# Matthew Blau <[email protected]> | ||
|
||
import functools | ||
|
@@ -30,7 +30,6 @@ def on_welcome(self, connection, event): | |
def on_login_failed(self, connection, event): | ||
print(event) | ||
|
||
|
||
def on_join(self, connection, event): | ||
self.send_it() | ||
|
||
|
@@ -47,10 +46,10 @@ def send_it(self): | |
|
||
|
||
def main(): | ||
server ="irc.libera.chat" | ||
server = "irc.libera.chat" | ||
port = 6697 | ||
nickname = "nickname" | ||
account_name="username" | ||
account_name = "username" | ||
target = "##channel" | ||
password = "" | ||
|
||
|
@@ -59,12 +58,20 @@ def main(): | |
context = ssl.create_default_context() | ||
wrapper = functools.partial(context.wrap_socket, server_hostname=server) | ||
|
||
c.connect(server, port, nickname, password,sasl_login=account_name, username=account_name, connect_factory=irc.connection.Factory(wrapper=wrapper)) | ||
c.connect( | ||
server, | ||
port, | ||
nickname, | ||
password, | ||
sasl_login=account_name, | ||
username=account_name, | ||
connect_factory=irc.connection.Factory(wrapper=wrapper), | ||
) | ||
except irc.client.ServerConnectionError as x: | ||
print(x) | ||
sys.exit(1) | ||
c.start() | ||
|
||
|
||
if __name__ == "__main__": | ||
main() | ||
main() |