irc-radio-bot/libs/Help.js

140 lines
4.5 KiB
JavaScript
Raw Normal View History

2019-12-24 11:30:41 +01:00
class Help {
/**
* Fonction affichant l'aide générale
* @param {Function} say
* @param {String} where
* @param {Array} args
*/
static show (say, where, args) {
if (args.length > 2) {
switch (args[2]) {
case '!artist':
case '!song':
Help.showArtistSong(say, where, args)
break
case '!stats':
Help.showStats(say, where)
break
case '!when':
Help.showWhen(say, where)
break
2019-12-25 13:47:42 +01:00
case '!list':
Help.showList(say, where)
break
2019-12-24 11:30:41 +01:00
case '!notifications':
Help.showNotifications(say, where)
break
2020-01-07 09:55:55 +01:00
case '!stream':
Help.showStream(say, where)
break
2019-12-24 11:30:41 +01:00
default:
break
}
} else {
say(where, 'IRC Radio Bot :: Help')
say(where, '!artist <add/del> {nom à sauvegarder si différent du morceau en cours}')
say(where, '!song <add/del> {nom à sauvegarder si différent du morceau en cours}')
2019-12-25 13:47:42 +01:00
say(where, '!stats <period> <artist/song>')
say(where, '!when <period> <artist/song>')
say(where, '!list <period> <artist/song>')
say(where, '!help {command}')
2019-12-24 11:30:41 +01:00
say(where, '!notifications <on/off/state>')
2020-01-07 09:55:55 +01:00
say(where, '!stream')
2019-12-24 11:30:41 +01:00
}
say(where, '__ END __')
}
2020-01-07 09:55:55 +01:00
/**
* Fonction affichant l'aide sur la commande !stream
* @param {Function} say
* @param {String} where
* @param {Array} args
*/
static showStream (say, where, args) {
say(where, 'IRC Radio Bot :: Stream')
say(where, '!stream < Affiche l\'url du flux radio pour ton player favoris')
}
2019-12-24 11:30:41 +01:00
/**
* Fonction affichant l'aide sur les commandes !artist et !song
* @param {Function} say
* @param {String} where
* @param {Array} args
*/
static showArtistSong (say, where, args) {
say(where, 'IRC Radio Bot :: Artist/Song')
say(where, `${args[2]} add {[facultatif] nom} < Permet de rajouter une notification sur ${args[2] === '!artist' ? 'cet artiste' : 'ce morceau'}`)
say(where, `${args[2]} del {[facultatif] nom} < Permet de supprimer une notification sur ${args[2] === '!artist' ? 'cet artiste' : 'ce morceau'}`)
}
/**
* Fonction affichant l'aide sur la commande !stats
* @param {Function} say
* @param {String} where
*/
static showStats (say, where) {
say(where, 'IRC Radio Bot :: Stats')
say(where, 'Permet d\'afficher le nombre de passage à l\'antenne d\'un artiste/morceau sur une période donnée')
say(where, '!stats day <title>')
say(where, '!stats week <title>')
say(where, '!stats month <title>')
say(where, '!stats year <title>')
say(where, '!stats lastday <title>')
say(where, '!stats lastweek <title>')
say(where, '!stats lastmonth <title>')
say(where, '!stats lastyear <title>')
}
/**
* Fonction affichant l'aide sur la commande !when
* @param {Function} say
* @param {String} where
*/
static showWhen (say, where) {
say(where, 'IRC Radio Bot :: When')
say(where, 'Permet d\'afficher la dernier passage d\'un artiste/morceau sur une période donnée')
say(where, '!when day <title>')
say(where, '!when week <title>')
say(where, '!when month <title>')
say(where, '!when year <title>')
say(where, '!when lastday <title>')
say(where, '!when lastweek <title>')
say(where, '!when lastmonth <title>')
say(where, '!when lastyear <title>')
}
2019-12-25 13:47:42 +01:00
/**
* Fonction affichant l'aide sur la commande !list
* @param {Function} say
* @param {String} where
*/
static showList (say, where) {
say(where, 'IRC Radio Bot :: List')
say(where, 'Permet d\'afficher la liste des titres joués pour un artiste sr une période donnée')
say(where, '!list day <artist>')
say(where, '!list week <artist>')
say(where, '!list month <artist>')
say(where, '!list year <artist>')
say(where, '!list lastday <artist>')
say(where, '!list lastweek <artist>')
say(where, '!list lastmonth <artist>')
say(where, '!list lastyear <artist>')
}
2019-12-24 11:30:41 +01:00
/**
* Fonction affichant l'aide sur la commande !notifications
* @param {Function} say
* @param {String} where
*/
static showNotifications (say, where) {
say(where, 'IRC Radio Bot :: Notifications')
say(where, 'Permet d\'activer et de désactiver les notifications pour soit')
say(where, '!notifications off')
say(where, '!notifications off')
say(where, '!notifications state < Permet de voir si l\'on a désactivé ou non les notifications')
}
}
module.exports = Help