Skip to content

Commit

Permalink
Fix connection issue
Browse files Browse the repository at this point in the history
  • Loading branch information
antoine-royer committed Jul 4, 2023
1 parent c6b5a65 commit 8b847cf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/irc_api/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.0.1"
__version__ = "1.0.2"
2 changes: 1 addition & 1 deletion src/irc_api/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def start(self, nick: str):
The nickname of the bot.
"""
# Start IRC
self.irc.connexion(nick, self.auth)
self.irc.connection(nick, self.auth)

# Join channels
for channel in self.channels:
Expand Down
8 changes: 3 additions & 5 deletions src/irc_api/irc.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


class IRC:
"""Manage connexion to an IRC server, authentication and callbacks.
"""Manage connection to an IRC server, authentication and callbacks.
Attributes
----------
Expand All @@ -25,7 +25,7 @@ class IRC:
Methods
-------
connexion : NoneType, public
connection : NoneType, public
Starts the IRC layer and manage authentication.
send : NoneType, public
Sends a message to a given channel.
Expand Down Expand Up @@ -63,7 +63,7 @@ def __init__(self, host: str, port: int):
self.__handler = Thread(target=self.__handle)

# Public methods
def connexion(self, nick: str, auth: tuple=()):
def connection(self, nick: str, auth: tuple=()):
"""Start the IRC layer. Manage authentication as well.
Parameters
Expand All @@ -82,8 +82,6 @@ def connexion(self, nick: str, auth: tuple=()):
self.waitfor(lambda m: "NOTICE" in m and "/AUTH" in m)
self.send(f"AUTH {auth[0]}:{auth[1]}")

self.waitfor(lambda m: "You are now logged in" in m)

self.connected = True

def send(self, raw: str):
Expand Down

0 comments on commit 8b847cf

Please sign in to comment.