A collection of Twitch related utilites for using them with your favorite bot. Written in deno.
You require Deno (as of now using 1.4.6). You also need to get a Twitch App ID and Secret (put them in .env
)
./run.sh
.
/follows/:from/:to
Returns a string with the time a user is following a channel
:from
: user following a channel/another user:to
: channel/user to be queried againstlang
: Language code to return the response into (defaults to es
)> GET /follows/thespectralmachine/danielapirata?lang=en
< thespectralmachine follows the channel 8 months, 1 days, 20 hours, 16 minutes and 34 seconds ago
Nightbot:
!addcom !followage $(urlfetch https://example.com/follows/$(querystring $(touser))/$(querystring $(channel)))
/channels/:channel/chatters/random
Returns a string with the name of a random chatter in a given channel
:channel
: channel to obtain a random chatter name from> GET /channels/macheenhs/chatters/random
< thespectralmachine
Nightbot:
!addcom !slap $(user) slaps $(urlfetch https://example.com/channels/macheenhs/chatters/random) in the face with a fish
/channels/:channel/emotes
Returns a (paginated) string with a list of BTTV and FF emotes available in a channel
:channel
: channel to obtain the emotes list frompage
: Page number. Defaults to 1
size
: Max character size per page. Defaults to 500
X-Pages
: Number of available pagesX-Page-Size
: Max character size for each page> GET /channels/topopablo11hs/emotes?page=1
< pepoS gachiBASS EZ FeelsRareMan pepeClap monkaShoot PepeHands ...
Nightbot:
!addcom !emotes $(urlfetch https://example.com/channels/$(querystring $(channel))/emotes?page=$(query))
Phantombot:
!addcom !emotes (customapi https://example.com/channels/(channelname)/emotes?page=(echo))
Author: Xpktro
Source Code: https://github.com/Xpktro/twitch-utils
#deno #nodejs #node #javascript