30 lines
904 B
Python
30 lines
904 B
Python
|
class Instance:
|
||
|
_instance = None
|
||
|
|
||
|
def __new__(cls):
|
||
|
if cls._instance is None:
|
||
|
cls._instance = super(Instance, cls).__new__(cls)
|
||
|
cls._instance.clear()
|
||
|
return cls._instance
|
||
|
|
||
|
def set_text_channel(self, channel_id):
|
||
|
"""テキストチャンネルIDを設定する"""
|
||
|
self.text_channel_id = channel_id
|
||
|
|
||
|
def get_text_channel(self):
|
||
|
"""現在接続中のテキストチャンネルIDを取得する"""
|
||
|
return self.text_channel_id
|
||
|
|
||
|
def set_name_reading(self, is_reading):
|
||
|
"""名前の読み上げ設定を行う"""
|
||
|
self.is_name_reading = is_reading
|
||
|
|
||
|
def get_name_reading(self):
|
||
|
"""名前の読み上げ設定を取得する"""
|
||
|
return self.is_name_reading
|
||
|
|
||
|
def clear(self):
|
||
|
"""初期化処理"""
|
||
|
self.text_channel_id = None
|
||
|
self.is_name_reading = False
|