Пример #1
0
        public async Task fmfriendsremoveallAsync()
        {
            User userSettings = await _userService.GetUserSettingsAsync(Context.User).ConfigureAwait(false);

            if (userSettings?.UserNameLastFM == null)
            {
                await UsernameNotSetErrorResponseAsync();

                return;
            }

            try
            {
                await _friendsService.RemoveAllLastFMFriendsAsync(userSettings.UserID).ConfigureAwait(false);

                await ReplyAsync("Removed all your friends.").ConfigureAwait(false);

                this._logger.LogCommandUsed(Context.Guild?.Id, Context.Channel.Id, Context.User.Id, Context.Message.Content);
            }
            catch (Exception e)
            {
                _logger.LogError(e.Message, Context.Message.Content, Context.User.Username, Context.Guild?.Name, Context.Guild?.Id);

                await ReplyAsync("Unable to remove all friends due to an internal error.").ConfigureAwait(false);
            }
        }
Пример #2
0
        public async Task fmremoveAsync()
        {
            User userSettings = await _userService.GetUserSettingsAsync(Context.User);

            if (userSettings == null)
            {
                await ReplyAsync("Sorry, but we don't have any data from you in our database.");

                return;
            }

            await _friendsService.RemoveAllLastFMFriendsAsync(userSettings.UserID);

            await _userService.DeleteUser(userSettings.UserID);

            await ReplyAsync("Your settings, friends and any other data have been successfully deleted.");

            this._logger.LogCommandUsed(Context.Guild?.Id, Context.Channel.Id, Context.User.Id, Context.Message.Content);
        }