THE Twitch Extension for your Deno-based Harmony Discord Bot
- Notifies you if your favorite streamers go live
Usage
In order to use this extension it is crucial to create a .env
file in the root directory of your Harmony bot. Within that file you need to include your client id and auth token you got from Twitch:
TWITCH_CLIENT_ID=
TWITCH_AUTH_TOKEN=
Example
A minimal example of using this extension:
import { CommandClient, Intents } from 'https://deno.land/x/harmony/mod.ts'
import { TwitchExtension } from 'https://deno.land/x/twitch-harmony/mod.ts'
const client = new CommandClient({
prefix: '!'
})
// load the extension
client.extensions.load(TwitchExtension)
client.on('ready', () => {
console.log(`Ready! User: ${client.user?.tag}`)
})
client.connect('mysecrettoken123', Intents.GuildMembers)
Testing
Tests are provided, so you are more than welcome to test this module with your own Twitch Credentials by running:
deno test -A --unstable