def randomVideoHandler(msg): """Display a random youtube video URL""" c = Command(None) videoLink = c.searchForLinks("VIDEO", None)[1].encode('ascii', 'ignore') logger.info('Responding with video message {0}'.format(videoLink)) msg.Chat.SendMessage(videoLink)