Ejemplo n.º 1
0
        public async Task CreateNote(CommandContext ctx, string idOrName, params string[] noteContentList)
        {
            if (Permissions.CheckPrivate(ctx))
            {
                return;
            }
            var mention     = ctx.Member.Mention;
            var noteContent = string.Join(" ", noteContentList);

            if (Permissions.CheckCommandPermission(ctx))
            {
                if (noteContent.Length > 1500)
                {
                    await DiscordBot.RespondAsync(ctx, mention + ", maximum note length is 1500 characters");
                }
                else if (DiscordBot.AddNote(idOrName, noteContent, ctx))
                {
                    await DiscordBot.RespondAsync(ctx, mention + ", note for **" + idOrName + "** added.");
                }
                else
                {
                    await DiscordBot.RespondAsync(ctx, mention + ", that didn't work.");
                }
            }
            else
            {
                await DiscordBot.RespondAsync(ctx, mention + ", you do not have permission to do that.");
            }
        }
Ejemplo n.º 2
0
        public async Task CreateNote(CommandContext ctx, string idOrName, string noteContent)
        {
            if (Permissions.CheckPrivate(ctx))
            {
                return;
            }
            var mention = ctx.Member.Mention;

            if (Permissions.CheckCommandPermission(ctx))
            {
                if (DiscordBot.AddNote(idOrName, noteContent, ctx))
                {
                    await DiscordBot.RespondAsync(ctx, mention + ", note for **" + idOrName + "** added.");
                }
                else
                {
                    await DiscordBot.RespondAsync(ctx, mention + ", that didn't work.");
                }
            }
            else
            {
                await DiscordBot.RespondAsync(ctx, mention + ", you do not have permission to do that.");
            }
        }