Fix uncaught userAlreadyInChannelException in channel __init__

This commit is contained in:
Giuseppe Guerra 2018-08-04 23:11:07 +02:00
parent c09c7b5d96
commit 74cfadb261
1 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,6 @@
import logging
from constants import exceptions
from objects import glob
class channel:
@ -23,7 +26,10 @@ class channel:
# Make Foka join the channel
fokaToken = glob.tokens.getTokenFromUserID(999)
if fokaToken is not None:
fokaToken.joinChannel(self)
try:
fokaToken.joinChannel(self)
except exceptions.userAlreadyInChannelException:
logging.warning("FokaBot has already joined channel {}".format(self.name))
@property
def isSpecial(self):