This repository has been archived by the owner on May 22, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
76 changed files
with
6,753 additions
and
4,527 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"env": { | ||
"test": { | ||
"plugins": [ "istanbul" ] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,37 @@ | ||
TWITCH_BOT_USER= | ||
TWITCH_BOT_OAUTH= | ||
COMPOSE_PROJECT_NAME=nozomibot | ||
|
||
# project environment | ||
NODE_ENV=prod | ||
|
||
# The command to type in console to quit | ||
EXIT_COMMAND=exit | ||
|
||
# Twitch IRC | ||
TWITCH_IDENTITY_USER= | ||
TWITCH_IDENTITY_PASSWORD= | ||
# Twitch API | ||
TWITCH_CLIENT_ID= | ||
TWITCH_CLIENT_SECRET= | ||
|
||
# example : #ashuvidz | ||
TWITCH_CHANNEL= | ||
# example : 46985892 | ||
TWITCH_CHANNEL_ID= | ||
|
||
# How long (in seconds) between two request Twitch API /streams | ||
TWITCH_REFRESH_STREAM_INFO_SCHEDULE_DELAY=60 | ||
# in minutes | ||
TWITCH_RESET_STREAM_INFO_SCHEDULE=600 | ||
|
||
# example : https://example.com | ||
WEBSERVER_BASE_URL= | ||
WEBSERVER_PORT=3000 | ||
TWITCH_WEBHOOK_STREAMS_CALLBACK_PATH=/twitch/streams | ||
|
||
# Mongodb server connection | ||
MONGO_HOST=mongo | ||
MONGO_PORT=27017 | ||
|
||
# Redis server connection | ||
REDIS_HOST=redis | ||
REDIS_PORT=6379 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/coverage | ||
.idea | ||
node_modules | ||
.env | ||
/var | ||
/test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
.idea | ||
node_modules | ||
.env | ||
.idea | ||
node_modules | ||
.env | ||
/var | ||
!/var/log/.gitkeep | ||
/coverage | ||
yarn-error.log | ||
package-lock.json | ||
.nyc_output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
language: node_js | ||
sudo: false | ||
node_js: | ||
- "8" | ||
cache: yarn | ||
install: | ||
- yarn install | ||
- yarn global add nyc | ||
|
||
# Following is used to create a mongo db user then run mongodb. This should be uncommented when Functionnal testing will be ready | ||
|
||
# services: | ||
# - mongodb | ||
#before_script: | ||
# - mongo mydb_test --eval 'db.createUser({user:"travis",pwd:"test",roles:["readWrite"]});' | ||
|
||
env: | ||
global: | ||
- NODE_ENV=dev | ||
- EXIT_COMMAND=exit | ||
script: | ||
- yarn lint | ||
- yarn test | ||
|
||
# Following is for activity tracking over Discord Webhook. | ||
|
||
after_success: | ||
- wget https://raw.githubusercontent.com/k3rn31p4nic/travis-ci-discord-webhook/master/send.sh | ||
- chmod +x send.sh | ||
- ./send.sh success $WEBHOOK_URL | ||
- npm run coveralls | ||
after_failure: | ||
- wget https://raw.githubusercontent.com/k3rn31p4nic/travis-ci-discord-webhook/master/send.sh | ||
- chmod +x send.sh | ||
- ./send.sh failure $WEBHOOK_URL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2018 Valentin Ronteix | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) | ||
UID:=$(shell id -u) | ||
GID:=$(shell id -g) | ||
|
||
cli: | ||
docker-compose exec node sh | ||
logs: | ||
docker-compose logs -f node | ||
|
||
up: | ||
docker-compose up -d $(c) | ||
down: | ||
docker-compose down $(c) | ||
down-volumes: | ||
docker-compose down -v $(c) | ||
start: | ||
docker-compose start $(c) | ||
stop: | ||
docker-compose stop $(c) | ||
restart: | ||
make stop && make start | ||
exec: | ||
docker-compose exec $(c) | ||
|
||
lint: | ||
make yarn c="lint" | ||
tests: | ||
make yarn c="test" | ||
|
||
yarn: | ||
docker run --rm -it -u $(UID):$(GID) --env-file $(ROOT_DIR)/.env -v $(ROOT_DIR):/app -w /app --init node:8-alpine yarn $(c) | ||
yu: | ||
make yarn c="upgrade $(c)" | ||
ya: | ||
make yarn c="add $(c) --dev" | ||
yi: | ||
make yarn c="install $(c)" | ||
|
||
install: | ||
cp .env.dist .env | ||
setfacl -dR -m u:$(UID):rwX -m u:1000:rwX var | ||
setfacl -R -m u:$(UID):rwX -m u:1000:rwX var | ||
make yi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
[![Greenkeeper badge](https://badges.greenkeeper.io/vyrtualsynthese/nozomiBot.svg)](https://greenkeeper.io/) [![Build Status](https://travis-ci.org/vyrtualsynthese/nozomiBot.svg?branch=master)](https://travis-ci.org/vyrtualsynthese/nozomiBot) [![Coverage Status](https://coveralls.io/repos/github/vyrtualsynthese/nozomiBot/badge.svg?branch=master)](https://coveralls.io/github/vyrtualsynthese/nozomiBot?branch=master) | ||
|
||
# NozomiBot | ||
|
||
This is a project for a Twitch/Youtube/Discord bot. Despite other bots, this one focus on easy setup and ready to use. | ||
|
||
## Getting Started | ||
|
||
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system. | ||
|
||
### Prerequisites | ||
|
||
What things you need to install the software and how to install them | ||
|
||
* [Docker](https://docs.docker.com/install/) | ||
* [Yarn](https://yarnpkg.com/lang/en/docs/install/) | ||
|
||
### Installing | ||
|
||
TODO: Installing on Local as prod then separate wiki page for deploy in remote server environnement. | ||
|
||
## Built With | ||
|
||
* [Nodejs](https://nodejs.org/en/) | ||
|
||
## Contributing | ||
|
||
Please read [Contribution Wiki Page](https://github.com/vyrtualsynthese/nozomiBot/wiki/Contributor-Guide) for details on our code of conduct, and the process for submitting pull requests to us. | ||
|
||
## Versioning | ||
|
||
We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/your/project/tags). | ||
|
||
## Authors | ||
|
||
* **Valentin RONTEIX** - *Initial work, Product Owner* - [vyrtualsynthese](https://github.com/vyrtualsynthese) | ||
* **Thomas TALBOT** - **Senior Dev** - [Ioni](https://github.com/Ioni14) | ||
|
||
See also the list of [contributors](https://github.com/vyrtualsynthese/nozomiBot/graphs/contributors) who participated in this project. | ||
|
||
## License | ||
|
||
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details | ||
|
||
## Acknowledgments | ||
|
||
* Hat tip to anyone whose code was used | ||
* Inspiration | ||
* etc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
|
||
Entrées/Sorties : std(in/out), twitch, discord, youtube live... | ||
généralisation entrée/sortie => ConnectorIO | ||
|
||
CommandHandler | ||
abstract Command (supports(CommandExchange) handle(CommandExchange):CommandResponse) | ||
exemple : TwitterListBotCommand extends Command | ||
|
||
ConnectorIO::write(CommandResponse); | ||
|
||
----------------------------------------- | ||
## Trucs à penser | ||
|
||
Cache avec Redis ? (ex : liste des 1000 derniers utilisateurs) | ||
|
||
----------------------------------------- | ||
## Backlog | ||
|
||
* Pouvoir restreindre les droits d'une commande : gestion de rôles uniformisés selon le ConnectorIO | ||
* Pouvoir write sur un autre Connector que l'input | ||
* Pouvoir éxecuter des commandes sans input (CRON ?) | ||
* Pouvoir enregistrer des états de commande selon l'invoqueur (exemple : ioni tape la commande "ashucoins", retourne SA propre donnée) | ||
* Sécurité antispam et antilien | ||
* Gestion statut modérateur connector Twitch | ||
* README.md | ||
|
||
----------------------------------------- | ||
## Planification Connectors. | ||
|
||
* Twitch | ||
* Youtube live | ||
* Discord | ||
* Streamlabs | ||
* GameWhisp | ||
* StreamerElements | ||
* Internal API | ||
|
||
----------------------------------------- | ||
## Twitch commands list | ||
|
||
* ~~commande qui liste les commandes statiques~~ | ||
* ~~commande qui liste toutes les commandes disponibles~~ (selon le rôle) | ||
* commandes pour un compteur de mort (par exemple pour les jeux try-hard) | ||
* activer/désactiver le compteur ("deathcounter on/off") | ||
* incr le nb morts ("deathcounterincr") | ||
* decr le nb morts ("deathcounterdecr") | ||
* set le nb morts ("deathcounterset X") | ||
* demander le nb morts ("deathcounter") | ||
* ~~"!last" pour avoir les dernières connexions viewers~~ | ||
* ~~"!game" pour avoir le nom du jeu actuel~~ | ||
* ~~"!title" pour le titre du stream + nom du jeu si en live~~ | ||
* "!playtime" pour le uptime du jeu actuel en live | ||
* ~~"!uptime" pour le uptime total du live~~ | ||
* "!pause" pour ne plus répondre aux commandes | ||
* "!resume" pour enlever "pause" | ||
* "!mute" pour ne pas envoyer de réponse | ||
* "!unmute" pour enlever "mute" | ||
* ~~"!users" pour avoir la liste des viewers~~ | ||
* ~~"!mods" pour avoir la liste des modos~~ | ||
* "!whispermode on/off" toutes les réponses sont envoyées en "whisper" à l'invoqueur | ||
* "!kill <target>" retourne "<invoqueur> a tué <target>!" (vérifier que target est bien un viewer/modo) | ||
* "!roll start/end <entier>" lance une roulette entre [[1, entier]] | ||
* "!rollvote <entier> <mise>" voter sur le roll avec la mise | ||
* ~~"!random <entier>" retourne un entier aléatoire entre [[1, entier]]~~ | ||
* "!bits on/off" active/désactive l'annonce lorsqu'il y a un don de bits | ||
* "!bitsmessage <message>" set le message qui sera affiché lorsqu'il y a un don en bits. Variables : %username%, %amount% | ||
* "!bitsminimum <entier>" set le nombre minimal de bits pour que le message soit affiché | ||
* "!clips on/off" active/désactive l'annonce lorsqu'il y a un clip de créé | ||
* "!clipsmessage <message>" set le message qui sera affiché lorsqu'il y a un clip de créé. Variables : %username%, %cliptitle% | ||
* "!lastclip" affiche le dernier clip capturé | ||
* "!topclip" affiche le lien vers le clip le plus regardé | ||
* "!streamlabs on/off" permet l'annonce ou pas les donateurs | ||
* "!streamlabsmessage <message>" set l'annonce | ||
* "!streamlabsminamount <float>" condition sur la donation pour afficher l'annonce | ||
* "!streamerelements on/off" permet l'annonce ou pas les donateurs | ||
* "!streamerelementsmessage <message>" set l'annonce | ||
* "!streamerelementsminamount <float>" condition sur la donation pour afficher l'annonce | ||
* "!followers on/off" permet l'annonce ou pas des follows | ||
* "!followersmessage <message>" set l'annonce | ||
* "!followcheck <username>" infos sur le suivi de la chaîne à propos de <username> | ||
* "!gamescan <gamename>" donne les stats sur un jeu joué sur la chaîne (combien de temps passé?....) | ||
* "!gamewhisp on/off" permet l'annonce ou pas des subs | ||
* "!gamewhisp <message>" set l'annonce | ||
* "!subs on/off" permet l'annonce ou pas des subs | ||
* "!subs <message>" set l'annonce | ||
* "!subwelcome on/off" permet l'annonce ou pas d'un greetings pour les subs | ||
* "!subwelcomemessage <message>" set l'annonce | ||
* "!host on/off" permet l'annonce ou pas des hosts (duplication du flux de la chaîne) | ||
* "!hostmessage <message>" set l'annonce | ||
* "!hostminviewers <entier>" condition sur le nombre minimum de viewers de l'autre chaîne pour afficher l'annonce | ||
* "!raid on/off" permet l'annonce ou pas des raids | ||
* "!raidmessage <message>" set l'annonce | ||
* "!raidminviewers <entier>" condition sur le nombre minimum de viewers de l'autre chaîne pour afficher l'annonce | ||
* "!addtimermessage <message>" ajoute un timer qui toutes les X secondes affiche <message> | ||
* "!changetimerinterval <seconds>" change l'intervalle en secondes du timer | ||
* "!listtimermessage" retourne les timers enregistrés avec leur ID dans l'ordre de leur position | ||
* "!deltimermessage <ID>" supprimer le timer <ID> | ||
* "!setpositiontimermessage <ID> <position>" échange le message <ID> avec le message à la position <position> | ||
* "!timer minactivity <nbmessages>" doit avoir au moins <nbmessages> entre deux timer messages d'affichés | ||
|
||
|
||
|
Oops, something went wrong.