Skip to content

Commit

Permalink
feat: Add Message Attachments Logging
Browse files Browse the repository at this point in the history
  • Loading branch information
sabihoshi committed Aug 12, 2022
1 parent 643a87c commit 2e688db
Show file tree
Hide file tree
Showing 7 changed files with 3,123 additions and 43 deletions.
16 changes: 16 additions & 0 deletions HuTao.Bot/Modules/Logging/LoggingModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,22 @@ [Remainder] [Summary("Leave empty to disable the appeal message.")]
await ReplyAsync(embed: embed.Build());
}

[Command("attachments")]
[Alias("attachment")]
[Summary("Re-upload attachments when messages are deleted.")]
public async Task ConfigureAttachmentsAsync(
[Summary("Set to 'true' or 'false'. Leave blank to toggle.")]
bool? reUpload = null)
{
var guild = await _db.Guilds.TrackGuildAsync(Context.Guild);
guild.LoggingRules ??= new LoggingRules();

guild.LoggingRules.UploadAttachments = reUpload ?? !guild.LoggingRules.UploadAttachments;
await _db.SaveChangesAsync();

await ReplyAsync($"Current value: {guild.LoggingRules.UploadAttachments}");
}

[Command("channel")]
[Summary("Set the channel to output the reprimand.")]
public async Task ConfigureChannelAsync(
Expand Down
Loading

0 comments on commit 2e688db

Please sign in to comment.