示例#1
0
 private async Task Ready(DiscordSocketClient client)
 {
     try { await _lavalinkManager.StartAsync(); }
     catch (Exception e) { Console.WriteLine(e.ToString()); }
     _httpClient.DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue(_client.CurrentUser.Username));
     PublicVariables.Application = await _client.GetApplicationInfoAsync();
 }
示例#2
0
        private async Task Ready()
        {
            await _client.SetGameAsync(Variables.ProgramVersion);

            await _lavalinkManager.StartAsync();

            Database.SyncDatabase(_client); /////////////////////////
        }
示例#3
0
        private async Task ShardReady(DiscordSocketClient client)
        {
            _shardsConnected++;

            if (_shardsConnected == _client.Shards.Count)
            {
                await SetupBot();

                await _lavaLink.StartAsync();

                await _lib.EdgyLog(LogSeverity.Info, $"All Shards Connected ({_client.Shards.Count})");
            }
        }
示例#4
0
        // Initializes Discord.Net
        private async Task Start()
        {
            _client         = new DiscordSocketClient();
            _handler        = new MessageHandler(_client);
            lavalinkManager = new LavalinkManager(_client);

            await _handler.Init();

            await _client.LoginAsync(TokenType.Bot, _token);

            await _client.StartAsync();

            _client.Ready += async() => {
                await lavalinkManager.StartAsync();
            };

            await Task.Delay(-1);
        }
示例#5
0
 private async Task LavalinkStart() => await _lavalink.StartAsync();
示例#6
0
        private async Task Ready()
        {
            await _lavalinkManager.StartAsync();

            await _discordBotListHandler.UpdateAsync();
        }