PetterKraabol / Twitch-Python

Object-oriented Twitch API for Python developers
https://pypi.org/project/twitch-python
MIT License
214 stars 37 forks source link

Edge case when Oauth starts with an 'h' #55

Open ameigen opened 3 months ago

ameigen commented 3 months ago

In the instance that your oauth key begins with the character 'h' it will be stripped from the password at IRC initialization and throw a login error.

class IRC(threading.Thread):

    def __init__(self, nickname: str, password: str, address: str = 'irc.chat.twitch.tv', port: int = 6667):
        super().__init__()

        self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        self.address: str = address
        self.port: int = port
        self.channels: List[str] = []
        self.nickname: str = nickname
        self.password: str = 'oauth:' + password.lstrip('oauth:')
        self.active: bool = True
        self.incoming: Subject = Subject()