Stop people from saving their own quotes

This commit is contained in:
Runebaas 2017-10-03 18:46:14 +02:00
parent 09dbb6b14d
commit c48a3b5d84
No known key found for this signature in database
GPG key ID: 2677AF508D0300D6

View file

@ -48,6 +48,11 @@ namespace Geekbot.net.Commands
{
try
{
if (user.Id == Context.Message.Author.Id)
{
await ReplyAsync("You can't save your own quotes...");
return;
}
var lastMessage = await getLastMessageByUser(user);
var quote = createQuoteObject(lastMessage);
var quoteStore = JsonConvert.SerializeObject(quote);
@ -68,6 +73,11 @@ namespace Geekbot.net.Commands
try
{
var message = await Context.Channel.GetMessageAsync(messageId);
if (message.Author.Id == Context.Message.Author.Id)
{
await ReplyAsync("You can't save your own quotes...");
return;
}
var quote = createQuoteObject(message);
var quoteStore = JsonConvert.SerializeObject(quote);
redis.SetAdd($"{Context.Guild.Id}:Quotes", quoteStore);