/// <summary>
        /// Handles leaving a guild. Calls the prune endpoint to clear out settings.
        /// </summary>
        private async Task HandleLeftGuildAsync(SocketGuild guild)
        {
            this.TrackEvent("serverLeave");

            SettingsConfig.RemoveSettings(guild.Id.ToString());

            if (this.Config.PruneEndpoint != null)
            {
                var req = WebRequest.Create($"{this.Config.PruneEndpoint}?id={guild.Id}");
                await req.GetResponseAsync();
            }

            await audioManager.LeaveAudioAsync(guild.Id);
        }
Beispiel #2
0
        /// <summary>
        /// Handles leaving a guild. Calls the prune endpoint to clear out settings.
        /// </summary>
        private async Task HandleLeftGuildAsync(SocketGuild guild)
        {
            this.TrackEvent("serverLeave");

            SettingsConfig.RemoveSettings(guild.Id.ToString());

            if (this.BotApi != null)
            {
                try
                {
                    await this.BotApi.IssueRequestAsync(new BotMessageData(BotType.Discord) { Content = ".prune", Prefix = ".", Server = guild.Id.ToString() });
                }
                catch (Exception ex)
                {
                    Log.Error(ex, $"Error calling prune command");
                }
            }

            await audioManager.LeaveAudioAsync(guild.Id);
        }