File tree 2 files changed +14
-1
lines changed
2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -138,6 +138,18 @@ The above code will create a text like this:
138
138
139
139
> Hello, [ @fedify @hollo.social] ( https://hollo.social/@fedify ) .
140
140
141
+ ### ` Emoji `
142
+
143
+ * This API is available since BotKit 0.2.0.*
144
+
145
+ If you put an ` Emoji ` object (provided by Fedify) inside the interpolation,
146
+ it will be rendered as a custom emoji. You usually get ` Emoji ` objects from
147
+ the ` Reaction.emoji ` property. For example:
148
+
149
+ ~~~~ typescript
150
+ text ` Here's a custom emoji: ${reaction .emoji }. `
151
+ ~~~~
152
+
141
153
### ` URL ` object
142
154
143
155
If you put a ` URL ` object inside the interpolation, it will be rendered as a
Original file line number Diff line number Diff line change 15
15
// along with this program. If not, see <https://www.gnu.org/licenses/>.
16
16
import {
17
17
type Actor ,
18
- type Emoji ,
18
+ Emoji ,
19
19
getActorHandle ,
20
20
isActor ,
21
21
Link ,
@@ -129,6 +129,7 @@ export class TemplatedText<TContextData>
129
129
if ( isText < TContextData > ( v ) ) return v ;
130
130
if ( v instanceof URL ) return link ( v ) ;
131
131
if ( isActor ( v ) ) return mention ( v ) ;
132
+ if ( v instanceof Emoji ) return customEmoji ( v ) ;
132
133
return new PlainText ( String ( v ) ) ;
133
134
} ) ;
134
135
}
You can’t perform that action at this time.
0 commit comments