Beispiel #1
0
        public async Task QuoteFrom(IUser user = null)
        {
            var userQuotes = QuoteModule.GetQuotesFrom(user);
            var result     = string.Join("\n", userQuotes.Select((q, index) => $"#{index} \"{q.QuoteText}\" {q.QuoteTime:yyyy-MM-dd}"));

            await ReplyAsync(result)
            .OnError(ex => Console.WriteLine("[ERROR]" + ex.Message));
        }
Beispiel #2
0
        public async Task Quote(
            [Summary("Mention a User")] IUser user,
            [Remainder, Summary("Quote text")] string quote)
        {
            if (quote.Length < 5)
            {
                await ReplyAsync("quote to short: " + quote);

                return;
            }

            await QuoteModule.AddQuote(new Quote()
            {
                CreatorID    = Context.Message.Author.Id,
                Created      = DateTime.Now,
                Enabled      = true,
                QuoteText    = quote,
                QuotedUserID = user.Id,
                QuoteTime    = DateTime.Now,
            });

            await ReplyAsync("Quote added: " + quote);
        }