void SetToken(string token) { if (token == bottoken) { return; } if (bottoken != null) { websocket.Connected -= OnConnected; websocket.MessageCreated -= OnMessage; websocket.Disconnect(); discord = null; } bottoken = token; context.Settings.Set(this, "bottoken", token); if (!string.IsNullOrEmpty(bottoken)) { websocket = new DiscordWebsocket(bottoken); websocket.Connected += OnConnected; websocket.MessageCreated += OnMessage; discord = new DiscordRest(bottoken, true); websocket.Connect(); } }
static async void MainAsync(string[] args) { var ERD = new ElectronRemoteDebugger("localhost", 9222); await DiscordWebsocket.Inject(ERD, "console.log('AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA')"); }