Ejemplo n.º 1
0
 public VoiceAssistantWorker(SocketGuildUser user, VoiceChannelWorker voiceChannelWorker, MetadataManager metadataManager, WitAiClient witAiClient)
 {
     _voiceChannelWorker = voiceChannelWorker;
     _metadataManager    = metadataManager;
     _witAiClient        = witAiClient;
     _user = user;
 }
Ejemplo n.º 2
0
        private Task OnReady()
        {
            var guild        = _client.Guilds.FirstOrDefault(g => g.Id == Program.DiscordServerId);
            var voiceChannel = guild.VoiceChannels.FirstOrDefault(c => c.Id == Program.DiscordChannelId);

            _voiceChannelWorker            = new VoiceChannelWorker(voiceChannel, _metadataManager, _playHistoryManager, _witAiClient);
            _voiceChannelWorker.OnStopped += (s, e) =>
            {
                _voiceChannelWorker.TryEnsureStarted();
            };
            _voiceChannelWorker.Start();
            return(Task.FromResult(0));
        }