This repository demonstrates the functionality of the TFxJS package. You can clone this repo and run using Docker.
In the root directory of the repository, create a .env file and fill it with your credentials:
CLIENT_ID=your_client_id
CLIENT_SECRET=your_client_secret
USER_ID=your_user_id
USER_REFRESH_TOKEN=your_refresh_token
docker-compose up --buildThe bot will be started inside a container. You can use docker-compose along with -d to run the container in the background.
docker logs -f twitch-botdocker-compose down@ChatCommand(CommandsModule.forFeature({
name: 'MyCommand',
keyword: 'my'
}))
export default class MyCommand implements ChatCommandExecution {
//...
}@TwitchBot({
//...
modules: [
//...
CommandsModule.forRoot({
commands: [MyCommand],
}),
//...
],
//...
})
class Bot {}Similarly if you want to add a listener:
@ChatListener(ListenersModule.forFeature({
name: 'ChatLogListener'
}))
export default class ChatLogListener implements ChatListenerExecution {
//...
}@TwitchBot({
//...
modules: [
//...
ListenersModule.forRoot({
listeners: [ChatLogListener],
}),
//...
],
//...
})
class Bot {}