163 lines
5.8 KiB
JavaScript
163 lines
5.8 KiB
JavaScript
|
|
class Help {
|
|
static helpSay (say, where, message) {
|
|
say(where, message, true, true)
|
|
}
|
|
|
|
/**
|
|
* 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
|
|
case '!list':
|
|
Help.showList(say, where)
|
|
break
|
|
case '!notifications':
|
|
Help.showNotifications(say, where)
|
|
break
|
|
case '!stream':
|
|
Help.showStream(say, where)
|
|
break
|
|
case '!mute':
|
|
Help.showMute(say, where)
|
|
break
|
|
default:
|
|
break
|
|
}
|
|
} else {
|
|
this.say(say, where, 'IRC Radio Bot :: Help')
|
|
this.say(say, where, '!artist <add/del> {nom à sauvegarder si différent du morceau en cours}')
|
|
this.say(say, where, '!song <add/del> {nom à sauvegarder si différent du morceau en cours}')
|
|
this.say(say, where, '!stats <period> {artist/song}')
|
|
this.say(say, where, '!when <period> <artist/song>')
|
|
this.say(say, where, '!list <period> <artist/song>')
|
|
this.say(say, where, '!help {command}')
|
|
this.say(say, where, '!notifications <on/off/state>')
|
|
this.say(say, where, '!stream')
|
|
this.say(say, where, '!mute <on/off/state>')
|
|
}
|
|
this.say(say, where, '__ END __')
|
|
}
|
|
|
|
/**
|
|
* Fonction affichant l'aide sur la commande !stream
|
|
* @param {Function} say
|
|
* @param {String} where
|
|
* @param {Array} args
|
|
*/
|
|
static showStream (say, where, args) {
|
|
this.say(say, where, 'IRC Radio Bot :: Stream', false, true)
|
|
this.say(say, where, 'Affiche l\'url du flux radio pour ton player favoris', false, true)
|
|
this.say(say, where, '!stream')
|
|
}
|
|
|
|
/**
|
|
* Fonction affichant l'aide sur la commande !mute
|
|
* @param {Function} say
|
|
* @param {String} where
|
|
* @param {Array} args
|
|
*/
|
|
static showMute (say, where, args) {
|
|
this.say(say, where, 'IRC Radio Bot :: Mute')
|
|
this.say(say, where, 'Permet d\'activer ou de désactiver les messages publics du bot')
|
|
this.say(say, where, '!mute on')
|
|
this.say(say, where, '!mute off')
|
|
this.say(say, where, '!mute state')
|
|
}
|
|
|
|
/**
|
|
* Fonction affichant l'aide sur les commandes !artist et !song
|
|
* @param {Function} say
|
|
* @param {String} where
|
|
* @param {Array} args
|
|
*/
|
|
static showArtistSong (say, where, args) {
|
|
this.say(say, where, 'IRC Radio Bot :: Artist/Song')
|
|
this.say(say, where, `${args[2]} add {[facultatif] nom} < Permet de rajouter une notification sur ${args[2] === '!artist' ? 'cet artiste' : 'ce morceau'}`)
|
|
this.say(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) {
|
|
this.say(say, where, 'IRC Radio Bot :: Stats')
|
|
this.say(say, where, 'Permet d\'afficher le nombre de passage à l\'antenne d\'un artiste/morceau sur une période donnée')
|
|
this.say(say, where, '!stats day <title>')
|
|
this.say(say, where, '!stats week <title>')
|
|
this.say(say, where, '!stats month <title>')
|
|
this.say(say, where, '!stats year <title>')
|
|
this.say(say, where, '!stats lastday <title>')
|
|
this.say(say, where, '!stats lastweek <title>')
|
|
this.say(say, where, '!stats lastmonth <title>')
|
|
this.say(say, where, '!stats lastyear <title>')
|
|
this.say(say, where, 'Si <title> n\'est pas spécifie la stats concerne le nombre d\'artistes différents pour cette période')
|
|
}
|
|
|
|
/**
|
|
* Fonction affichant l'aide sur la commande !when
|
|
* @param {Function} say
|
|
* @param {String} where
|
|
*/
|
|
static showWhen (say, where) {
|
|
this.say(say, where, 'IRC Radio Bot :: When')
|
|
this.say(say, where, 'Permet d\'afficher la dernier passage d\'un artiste/morceau sur une période donnée')
|
|
this.say(say, where, '!when day <title>')
|
|
this.say(say, where, '!when week <title>')
|
|
this.say(say, where, '!when month <title>')
|
|
this.say(say, where, '!when year <title>')
|
|
this.say(say, where, '!when lastday <title>')
|
|
this.say(say, where, '!when lastweek <title>')
|
|
this.say(say, where, '!when lastmonth <title>')
|
|
this.say(say, where, '!when lastyear <title>')
|
|
}
|
|
|
|
/**
|
|
* Fonction affichant l'aide sur la commande !list
|
|
* @param {Function} say
|
|
* @param {String} where
|
|
*/
|
|
static showList (say, where) {
|
|
this.say(say, where, 'IRC Radio Bot :: List')
|
|
this.say(say, where, 'Permet d\'afficher la liste des titres joués pour un artiste sr une période donnée')
|
|
this.say(say, where, '!list day <artist>')
|
|
this.say(say, where, '!list week <artist>')
|
|
this.say(say, where, '!list month <artist>')
|
|
this.say(say, where, '!list year <artist>')
|
|
this.say(say, where, '!list lastday <artist>')
|
|
this.say(say, where, '!list lastweek <artist>')
|
|
this.say(say, where, '!list lastmonth <artist>')
|
|
this.say(say, where, '!list lastyear <artist>')
|
|
}
|
|
|
|
/**
|
|
* Fonction affichant l'aide sur la commande !notifications
|
|
* @param {Function} say
|
|
* @param {String} where
|
|
*/
|
|
static showNotifications (say, where) {
|
|
this.say(say, where, 'IRC Radio Bot :: Notifications')
|
|
this.say(say, where, 'Permet d\'activer et de désactiver les notifications pour soit')
|
|
this.say(say, where, '!notifications off')
|
|
this.say(say, where, '!notifications off')
|
|
this.say(say, where, '!notifications state < Permet de voir si l\'on a désactivé ou non les notifications')
|
|
}
|
|
}
|
|
|
|
module.exports = Help
|