mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 17:58:26 -04:00
add: added .snipe command
add: added .gsreset and .bsreset commands change: improved .timely rewards for patrons dev: Improved how blacklist works under the hood
This commit is contained in:
@@ -783,4 +783,28 @@ public partial class Utility : NadekoModule
|
||||
await Response().Error(ex.Message).SendAsync();
|
||||
}
|
||||
}
|
||||
|
||||
[Cmd]
|
||||
public async Task Snipe()
|
||||
{
|
||||
if (ctx.Message.ReferencedMessage is not { } msg)
|
||||
{
|
||||
var msgs = await ctx.Channel.GetMessagesAsync(ctx.Message, Direction.Before, 3).FlattenAsync();
|
||||
msg = msgs.FirstOrDefault(x => !string.IsNullOrWhiteSpace(x.Content) || (x.Attachments.FirstOrDefault()?.Width is not null)) as IUserMessage;
|
||||
|
||||
if (msg is null)
|
||||
return;
|
||||
}
|
||||
|
||||
var eb = _sender.CreateEmbed()
|
||||
.WithOkColor()
|
||||
.WithDescription(msg.Content)
|
||||
.WithAuthor(msg.Author)
|
||||
.WithTimestamp(msg.Timestamp)
|
||||
.WithImageUrl(msg.Attachments.FirstOrDefault()?.Url)
|
||||
.WithFooter(GetText(strs.sniped_by(ctx.User.ToString())), ctx.User.GetDisplayAvatarUrl());
|
||||
|
||||
ctx.Message.DeleteAfter(1);
|
||||
await Response().Embed(eb).SendAsync();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user