mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 09:48:26 -04:00
- .say replacement fix
- .send and .qid now use smarttext instead of crembed - added + operator for adding string to smarttext
This commit is contained in:
@@ -174,18 +174,10 @@ namespace NadekoBot.Modules.Utility
|
||||
|
||||
var infoText = $"`#{quote.Id} added by {quote.AuthorName.SanitizeAllMentions()}` 🗯️ " + quote.Keyword.ToLowerInvariant().SanitizeAllMentions() + ":\n";
|
||||
|
||||
if (CREmbed.TryParse(quote.Text, out var crembed))
|
||||
{
|
||||
rep.Replace(crembed);
|
||||
|
||||
await ctx.Channel.EmbedAsync(crembed.ToEmbed(_eb), infoText + crembed.PlainText?.SanitizeAllMentions())
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
await ctx.Channel.SendMessageAsync(infoText + rep.Replace(quote.Text)?.SanitizeAllMentions())
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
|
||||
var text = SmartText.CreateFrom(quote.Text);
|
||||
text = rep.Replace(text);
|
||||
await ctx.Channel.SendAsync(_eb, infoText + text, true);
|
||||
}
|
||||
|
||||
[NadekoCommand, Aliases]
|
||||
|
@@ -35,7 +35,6 @@ namespace NadekoBot.Modules.Utility
|
||||
_creds = creds;
|
||||
_tracker = tracker;
|
||||
}
|
||||
|
||||
|
||||
[NadekoCommand, Aliases]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
@@ -47,7 +46,7 @@ namespace NadekoBot.Modules.Utility
|
||||
.WithDefault(ctx.User, channel, (SocketGuild)ctx.Guild, (DiscordSocketClient)ctx.Client)
|
||||
.Build();
|
||||
|
||||
rep.Replace(message);
|
||||
message = rep.Replace(message);
|
||||
|
||||
await channel.SendAsync(_eb, message, !((IGuildUser)Context.User).GuildPermissions.MentionEveryone);
|
||||
}
|
||||
@@ -56,7 +55,7 @@ namespace NadekoBot.Modules.Utility
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageMessages)]
|
||||
[Priority(0)]
|
||||
public Task Say([Leftover] string message)
|
||||
public Task Say([Leftover] SmartText message)
|
||||
=> Say((ITextChannel)ctx.Channel, message);
|
||||
|
||||
[NadekoCommand, Aliases]
|
||||
|
Reference in New Issue
Block a user