mirror of
https://github.com/MCMi460/3DS-RPC.git
synced 2025-06-18 21:45:37 -04:00
Slight ease of use update
This commit is contained in:
parent
89f3fc0cc4
commit
c3926015c5
14
api/util.py
14
api/util.py
@ -4,6 +4,7 @@ import os, sys
|
||||
import sqlite3
|
||||
import time
|
||||
import threading
|
||||
import traceback
|
||||
if os.name == 'nt':
|
||||
import pyreadline3
|
||||
else:
|
||||
@ -210,11 +211,14 @@ class Console():
|
||||
self, directive:['connect', 'disconnect'] = 'connect', pipe:int = 0
|
||||
Pipe refers to which Discord client to connect to. May be rather fickle.
|
||||
"""
|
||||
if directive == 'connect':
|
||||
self._log('Attempting to connect to Discord...', Color.YELLOW)
|
||||
self.client.connect(pipe)
|
||||
else:
|
||||
self.client.disconnect()
|
||||
try:
|
||||
if directive == 'connect':
|
||||
self._log('Attempting to connect to Discord...', Color.YELLOW)
|
||||
self.client.connect(pipe)
|
||||
else:
|
||||
self.client.disconnect()
|
||||
except:
|
||||
self._log(traceback.format_exc(), Color.RED)
|
||||
return self._log('Done', Color.BLUE)
|
||||
|
||||
def log(self):
|
||||
|
@ -4,7 +4,6 @@ from PyQt5.QtWidgets import *
|
||||
from PyQt5.QtGui import *
|
||||
from PyQt5.QtCore import *
|
||||
from layout import Ui_MainWindow
|
||||
import traceback
|
||||
from client import *
|
||||
from client import _REGION
|
||||
|
||||
|
@ -180,7 +180,7 @@ def main():
|
||||
# Begin main thread for user configuration
|
||||
con = Console(client)
|
||||
try:
|
||||
con.discord('connect')
|
||||
client.connect()
|
||||
except Exception as e:
|
||||
con._log('\'%s\'\nFailed to connect to Discord! Try again with the \'discord\' command' % e, Color.RED)
|
||||
con._main()
|
||||
|
Loading…
Reference in New Issue
Block a user