mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-12 02:08:27 -04:00
- .say now uses new SmartText instead of CREmbed
- Added IMessageChannel extensions for sending smarttext - Added implicit operator from string to smarttext (which just creates smartplaintext instance)
This commit is contained in:
@@ -2,15 +2,17 @@
|
||||
|
||||
namespace NadekoBot
|
||||
{
|
||||
// todo 3.3 check if saving embeds in db has IsEmbed field, to prevent rechecking and generating exceptions on every use
|
||||
public abstract class SmartText
|
||||
{
|
||||
public bool IsEmbed => this is SmartEmbedText;
|
||||
public bool IsPlainText => this is SmartPlainText;
|
||||
|
||||
public static implicit operator SmartText(string input)
|
||||
=> new SmartPlainText(input);
|
||||
|
||||
public static SmartText CreateFrom(string input)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(input) || !input.Trim().StartsWith("{"))
|
||||
if (string.IsNullOrWhiteSpace(input) || !input.TrimStart().StartsWith("{"))
|
||||
{
|
||||
return new SmartPlainText(input);
|
||||
}
|
||||
|
Reference in New Issue
Block a user