mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 09:18:27 -04:00
.boostmsg will now properly show boost, and not greet message
This commit is contained in:
@@ -4,7 +4,13 @@ Experimental changelog. Mostly based on [keepachangelog](https://keepachangelog.
|
||||
|
||||
## Unreleased
|
||||
|
||||
### Changed
|
||||
|
||||
- Ban `.warnp` will now prune user's messages
|
||||
|
||||
### Fixed
|
||||
|
||||
- `.boostmsg` will now properly show boost, and not greet message
|
||||
|
||||
## [3.0.2] - 12.09.2021
|
||||
|
||||
|
@@ -41,6 +41,15 @@ namespace NadekoBot.Modules.Administration
|
||||
await ReplyPendingLocalizedAsync(strs.boostdel_off).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
[NadekoCommand, Aliases]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageGuild)]
|
||||
public Task BoostMsg()
|
||||
{
|
||||
var boostMessage = _service.GetBoostMessage(ctx.Guild.Id);
|
||||
return ReplyConfirmLocalizedAsync(strs.boostmsg_cur(boostMessage?.SanitizeMentions()));
|
||||
}
|
||||
|
||||
[NadekoCommand, Aliases]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageGuild)]
|
||||
@@ -48,7 +57,7 @@ namespace NadekoBot.Modules.Administration
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(text))
|
||||
{
|
||||
await GreetMsg().ConfigureAwait(false);
|
||||
await BoostMsg().ConfigureAwait(false);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -173,6 +173,12 @@ namespace NadekoBot.Services
|
||||
}
|
||||
}
|
||||
|
||||
public string GetBoostMessage(ulong gid)
|
||||
{
|
||||
using var uow = _db.GetDbContext();
|
||||
return uow.GuildConfigsForId(gid, set => set).BoostMessage;
|
||||
}
|
||||
|
||||
private Task ByeUsers(GreetSettings conf, ITextChannel channel, IUser user)
|
||||
=> ByeUsers(conf, channel, new[] {user});
|
||||
private async Task ByeUsers(GreetSettings conf, ITextChannel channel, IEnumerable<IUser> users)
|
||||
|
Reference in New Issue
Block a user