diff --git a/src/EllieBot/Modules/Administration/GreetBye/GreetCommands.cs b/src/EllieBot/Modules/Administration/GreetBye/GreetCommands.cs index 53dd058..104e4e7 100644 --- a/src/EllieBot/Modules/Administration/GreetBye/GreetCommands.cs +++ b/src/EllieBot/Modules/Administration/GreetBye/GreetCommands.cs @@ -225,5 +225,19 @@ public partial class Administration if (!enabled) await Response().Pending(strs.greetdmmsg_enable($"`{prefix}greetdm`")).SendAsync(); } + + [Cmd] + [RequireContext(ContextType.Guild)] + [UserPerm(GuildPerm.ManageGuild)] + [Ratelimit(5)] + public async Task BoostTest([Leftover] IGuildUser? user = null) + { + user ??= (IGuildUser)ctx.User; + + await _service.BoostTest((ITextChannel)ctx.Channel, user); + var enabled = _service.GetBoostEnabled(ctx.Guild.Id); + if (!enabled) + await Response().Pending(strs.boostmsg_enable($"`{prefix}boost`")).SendAsync(); + } } } \ No newline at end of file diff --git a/src/EllieBot/Modules/Administration/GreetBye/GreetService.cs b/src/EllieBot/Modules/Administration/GreetBye/GreetService.cs index aec7e9e..1511913 100644 --- a/src/EllieBot/Modules/Administration/GreetBye/GreetService.cs +++ b/src/EllieBot/Modules/Administration/GreetBye/GreetService.cs @@ -242,7 +242,7 @@ public class GreetService : IEService, IReadyExecutor guild: channel.Guild, channel: channel, users: users.ToArray()); - + var text = SmartText.CreateFrom(conf.ChannelGreetMessageText); text = await _repSvc.ReplaceAsync(text, repCtx); try @@ -630,6 +630,13 @@ public class GreetService : IEService, IReadyExecutor return conf.SendChannelByeMessage; } + public bool GetBoostEnabled(ulong guildId) + { + using var uow = _db.GetDbContext(); + var conf = uow.GuildConfigsForId(guildId, set => set); + return conf.SendBoostMessage; + } + #endregion #region Test Messages