custom slap conmmands

trial and error, I found a way that works for me, using a quote system

$(eval t=`$(urlfetch http://twitch.center/customapi/quote?token=0ff178fe&no_id=1)`;t=t.replace(`%randUser`,`$(urlfetch https://2g.be/twitch/randomviewer.php?channel=$(channel))`).replace(`%user`,`$(user)`);t;)

then I want to customize the command so that you can use querystring, and maybe the second argument, such as

!slap nick nick
the first argument will be the one who slaps, and the second one who gets

If someone else can improve the code that I wrote above with a quotation system or pastebin (which never worked for me), please write in the comments, I would really like to see the implementation of these features, from those who know how to write this or that code in short.
Thanks to all
PS one more request, I looked at the forum a few topics about pastebin, one more request, I looked at the forum on several topics about pastebin, and I would like from those who know more than me how to use pastebin to extend the code, it just came up with the idea of making more replaceable variables in the template quote system, besides %user %randUser add %rand (randomNumber) etc
if possible, then write in the answer how to do it correctly, without errors
thanks in advance