Skip to content

Show a tag if the clipboard contains a youtube link #146

Answered by SilentVoid13
e5pe asked this question in Help
Discussion options

You must be logged in to vote

Hey @e5pe, you're missing the await keyword, because tp.system.clipboard is an asynchronous function.
The correct template would be:

<%*
var tag =  "#link";
const clipboard = await tp.system.clipboard();
if (clipboard.contains("youtube") || clipboard.contains("youtu.be")) {
    tag =  "#youtube";
} 
tR += tag;
%>

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@e5pe
Comment options

Answer selected by SilentVoid13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants