コード例 #1
0
ファイル: EpgpModule.cs プロジェクト: mfuqua3/BuzzBot
        public async Task DeleteAlias(string aliasName)
        {
            await _queryService.SendQuery(
                $"Are you sure you want to delete all record of {aliasName}? The user record will be retained, but all record of this alias will be purged. This can not be undone.",
                Context.Channel,
                async() =>
            {
                try
                {
                    _aliasService.DeleteAlias(aliasName);
                }
                catch (Exception ex)
                {
                    await ReplyAsync($"Unable to successfully remove alias: {ex.Message}");
                    return;
                }

                await ReplyAsync("Alias removed successfully.");
            },
                async() => { await ReplyAsync("Operation cancelled"); });
        }