mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-13 02:38:27 -04:00
* Replacement mechanism reworked
* Services can now register their own replacements * Possible bugs and/or backwards-incompatible behavior
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
#nullable disable
|
||||
using Microsoft.CodeAnalysis.CSharp.Scripting;
|
||||
using Microsoft.CodeAnalysis.Scripting;
|
||||
using NadekoBot.Modules.Utility.Services;
|
||||
using Newtonsoft.Json;
|
||||
using System.Diagnostics;
|
||||
@@ -61,11 +59,12 @@ public partial class Utility : NadekoModule
|
||||
[Priority(1)]
|
||||
public async Task Say(ITextChannel channel, [Leftover] SmartText message)
|
||||
{
|
||||
var rep = new ReplacementBuilder()
|
||||
.WithDefault(ctx.User, channel, (SocketGuild)ctx.Guild, (DiscordSocketClient)ctx.Client)
|
||||
.Build();
|
||||
// var rep = new ReplacementBuilder()
|
||||
// .WithDefault(ctx.User, channel, (SocketGuild)ctx.Guild, (DiscordSocketClient)ctx.Client)
|
||||
// .Build();
|
||||
|
||||
message = rep.Replace(message);
|
||||
var repCtx = new ReplacementContext(Context);
|
||||
message = await repSvc.ReplaceAsync(message, repCtx);
|
||||
|
||||
await channel.SendAsync(message, !((IGuildUser)ctx.User).GuildPermissions.MentionEveryone);
|
||||
}
|
||||
|
Reference in New Issue
Block a user