def onOpen(self): if debug: print("[Connection] Connection established!") self.block_chat = False # It will block chat when question are shown self.chat = Chat() self.solver = Solver() """ Game Summary """ self.gs_enable = readFromConfig("GameSummary", "enable") self.gs_prize = readFromConfig("GameSummary", "show_prize") self.gs_userids = readFromConfig("GameSummary", "show_userids") self.gs_usernames = readFromConfig("GameSummary", "show_usernames")
def onOpen(self): if debug: print("[Connection] Connection established!") self.block_chat = True # It will block chat when question are shown self.chat = Chat() self.consume = Consumer() """ Broadcast Stats """ self.bs_enable = readFromConfig("BroadcastStats", "enable") self.bs_connected = readFromConfig("BroadcastStats", "show_connected") self.bs_playing = readFromConfig("BroadcastStats", "show_playing") self.bs_eliminated = readFromConfig("BroadcastStats", "show_eliminated") """ Game Summary """ self.gs_enable = readFromConfig("GameSummary", "enable") self.gs_prize = readFromConfig("GameSummary", "show_prize") self.gs_userids = readFromConfig("GameSummary", "show_userids") self.gs_usernames = readFromConfig("GameSummary", "show_usernames")
def __init__(self): self.api_shows = readFromConfig("API", "shows_now") self.debug = readFromConfig("General", "debug_mode") self.server_ip = readFromConfig("General", "server_ip")
def __init__(self): self.debug = readFromConfig("General", "debug_mode") self.google_api_key = readFromConfig("Solver", "google_api_key") self.google_cse_id = readFromConfig("Solver", "google_cse_id") self.show_advancing_players = readFromConfig("Solver", "show_advancing_players") self.show_answers = readFromConfig("Solver", "show_answers") self.show_answerids = readFromConfig("Solver", "show_answerids") self.show_category = readFromConfig("Solver", "show_category") self.show_eliminated_players = readFromConfig( "Solver", "show_eliminated_players") self.show_summary = readFromConfig("Solver", "show_summary") self.show_players_answers = readFromConfig("Solver", "show_players_answers") self.show_question = readFromConfig("Solver", "show_question") self.show_questionid = readFromConfig("Solver", "show_questionid") self.show_question_count = readFromConfig("Solver", "show_question_count") self.show_question_number = readFromConfig("Solver", "show_question_number") self.use_naive = readFromConfig("Solver", 'use_naive') self.use_google = readFromConfig("Solver", "use_google") self.use_wiki = readFromConfig("Solver", "use_wiki") if self.use_naive: self.naive = Naive(self.google_api_key, self.google_cse_id, self.debug) if self.use_google: self.google = Google(self.debug) if self.use_wiki: self.wiki = Wikipedia(self.debug)
import json import sys from chat import Chat from config import readFromConfig from dataclasses import Data from consumer import Consumer from autobahn.twisted.websocket import WebSocketClientFactory, WebSocketClientProtocol from shutil import get_terminal_size from twisted.internet.protocol import ReconnectingClientFactory debug = readFromConfig("General", "debug_mode") class GameProtocol(WebSocketClientProtocol): def onOpen(self): if debug: print("[Connection] Connection established!") self.block_chat = True # It will block chat when question are shown self.chat = Chat() self.consume = Consumer() """ Broadcast Stats """ self.bs_enable = readFromConfig("BroadcastStats", "enable") self.bs_connected = readFromConfig("BroadcastStats", "show_connected") self.bs_playing = readFromConfig("BroadcastStats", "show_playing") self.bs_eliminated = readFromConfig("BroadcastStats", "show_eliminated") """ Game Summary """ self.gs_enable = readFromConfig("GameSummary", "enable") self.gs_prize = readFromConfig("GameSummary", "show_prize")
def __init__(self): self.debug = readFromConfig("General", "debug_mode") self.show_advancing_players = readFromConfig("Solver", "show_advancing_players") self.show_answers = readFromConfig("Solver", "show_answers") self.show_answerids = readFromConfig("Solver", "show_answerids") self.show_category = readFromConfig("Solver", "show_category") self.show_eliminated_players = readFromConfig( "Solver", "show_eliminated_players") self.show_summary = readFromConfig("Solver", "show_summary") self.show_players_answers = readFromConfig("Solver", "show_players_answers") self.show_question = readFromConfig("Solver", "show_question") self.show_questionid = readFromConfig("Solver", "show_questionid") self.show_question_count = readFromConfig("Solver", "show_question_count") self.show_question_number = readFromConfig("Solver", "show_question_number")
def __init__(self): self.enable = readFromConfig("Chat", "enable") self.show_kicked = readFromConfig("Chat", "show_kicked") self.show_message = readFromConfig("Chat", "show_message") self.show_usernames = readFromConfig("Chat", "show_usernames") self.show_userids = readFromConfig("Chat", "show_userids")