IRCServer.Server.get_user
should be 'typing.Optional[IRCUser.User]', not just
'IRCUser.user'
This commit is contained in:
parent
5001e47af9
commit
3061c65024
1 changed files with 2 additions and 1 deletions
|
@ -182,7 +182,8 @@ class Server(IRCObject.Object):
|
||||||
|
|
||||||
def has_user(self, nickname: str) -> bool:
|
def has_user(self, nickname: str) -> bool:
|
||||||
return utils.irc.lower(self.case_mapping, nickname) in self.users
|
return utils.irc.lower(self.case_mapping, nickname) in self.users
|
||||||
def get_user(self, nickname: str, create: bool=True) -> IRCUser.User:
|
def get_user(self, nickname: str, create: bool=True
|
||||||
|
) -> typing.Optional[IRCUser.User]:
|
||||||
if not self.has_user(nickname) and create:
|
if not self.has_user(nickname) and create:
|
||||||
user_id = self.get_user_id(nickname)
|
user_id = self.get_user_id(nickname)
|
||||||
new_user = IRCUser.User(nickname, user_id, self, self.bot)
|
new_user = IRCUser.User(nickname, user_id, self, self.bot)
|
||||||
|
|
Loading…
Reference in a new issue