Emoji Paster
Search & paste emojis
This command illustrates how to return an interactive List view. In this case, we visualize emojis and their names. As you type, the command matches the emoji name. When you hit Enter, the command pastes the selected emoji in the active app.
In this example, you'll also notice that you can use an emoji as a custom icon for an Option.
1
/**
2
* A command that shows a selection of emojis and pastes
3
* the selected emoji on pressing Enter.
4
*/
5
const response = {
6
view: {
7
type: "list",
8
options: [
9
{
10
title: "Heart",
11
action: {
12
type: "paste",
13
value: "❤️",
14
},
15
icon: "❤️",
16
},
17
{
18
title: "Star",
19
action: {
20
type: "paste",
21
value: "⭐️",
22
},
23
icon: "⭐️",
24
},
25
{
26
title: "Lightning",
27
action: {
28
type: "paste",
29
value: "️⚡️",
30
},
31
icon: "⚡️",
32
},
33
],
34
},
35
};
36
37
console.log(JSON.stringify(response));
Copied!
Last modified 6d ago
Copy link