public async Task DeleteRaid()
        {
            bool confirmed = await JSRuntime.InvokeAsync <bool>("confirm", $"Are you sure you want to raid {Raid.Date.ToString("yyyy-MM-dd")}?");

            if (confirmed)
            {
                await RaidService.DeleteRaid(Raid);

                Raids.DeleteRaid(Raid);
            }
        }
Exemple #2
0
        public async Task CreateRaid(int id)
        {
            try
            {
                var raid  = service.DeleteRaid(id, Context.Guild.Id.ToString());
                var embed = Helpers.GetEmbed(raid.RaidTitle, "ID:", raid.Id.ToString()).AddField("Date: ", raid.RaidDay.ToString("dd-MM HH:mm"));
                await Context.Channel.SendMessageAsync("", false, embed.Build());

                await Context.Channel.SendMessageAsync("Raid set inactive");
            }
            catch (Exception e)
            {
                await Context.Channel.SendMessageAsync(e.Message + "Use format: !deleteraid RaidId");

                var lm = new LogMessageService();
                await lm.CreateLogEntry(e.Message, e.StackTrace);
            }
        }
Exemple #3
0
        public async Task Delete([Summary("Name of the raid to delete")] string raidName)
        {
            var user = Context.User as IGuildUser;

            if (await CheckPermission(user, _serverPermissions))
            {
                var result = _raidService.DeleteRaid(raidName, user);
                if (result.Success)
                {
                    MessageAllUsers(result);
                }
                else
                {
                    var dmChannel = await user.GetOrCreateDMChannelAsync();

                    await dmChannel.SendMessageAsync("", false, result.RequesterUserBuilder.Build());
                }
            }
        }