Add secret_key config
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
TOKEN = YOUR_BOT_TOKEN
|
||||
CLIENT_ID = YOUR_BOT_CLIENT_ID
|
||||
CLIENT_SECRET_ID = YOUR_BOT_CLIENT_SECRET_ID
|
||||
SERCET_KEY = DASHBOARD_SERCET_KEY
|
||||
|
||||
BUG_REPORT_CHANNEL_ID = YOUR_DISCORD_CHANNEL_ID
|
||||
|
||||
|
||||
6
main.py
6
main.py
@@ -32,9 +32,9 @@ class Vocard(commands.Bot):
|
||||
|
||||
self.ipc = IPCServer(
|
||||
self,
|
||||
func.settings.ipc_server["host"],
|
||||
func.settings.ipc_server["port"],
|
||||
sercet_key="Vocard"
|
||||
host=func.settings.ipc_server["host"],
|
||||
port=func.settings.ipc_server["port"],
|
||||
sercet_key=os.getenv("SERCET_KEY")
|
||||
)
|
||||
|
||||
async def on_message(self, message: discord.Message, /) -> None:
|
||||
|
||||
@@ -14,7 +14,7 @@ import threading
|
||||
load_dotenv()
|
||||
|
||||
app = Flask(__name__)
|
||||
app.secret_key = "aNOwneoiniowefn"
|
||||
app.secret_key = os.getenv("SERCET_KEY")
|
||||
socketio = SocketIO(app)
|
||||
|
||||
# Discord OAuth2 credentials
|
||||
@@ -26,7 +26,7 @@ DISCORD_API_BASE_URL = 'https://discord.com/api'
|
||||
USERS = {}
|
||||
|
||||
def start_ipc_client(loop):
|
||||
client = IPCClient(secret_key="Vocard")
|
||||
client = IPCClient(secret_key=app.secret_key)
|
||||
asyncio.set_event_loop(loop)
|
||||
loop.run_until_complete(client.connect())
|
||||
|
||||
@@ -34,7 +34,7 @@ def create_ipc_client():
|
||||
loop = asyncio.new_event_loop()
|
||||
threading.Thread(target=start_ipc_client,
|
||||
args=(loop,), daemon=True).start()
|
||||
return IPCClient(secret_key="Vocard", callback=message_handler)
|
||||
return IPCClient(secret_key=app.secret_key, callback=message_handler)
|
||||
|
||||
def get_user(user_id: int):
|
||||
for user in USERS.values():
|
||||
|
||||
Reference in New Issue
Block a user