Modération Twitch avec Nightbot¶
Par défaut Nightbot liste les commandes sur une page dédiée à chaque chaîne au format https://nightbot.tv/t/<channel>/commands
Le dashboard d'administration du bot est dispo à l'URL https://nightbot.tv/dashboard
Attention
Comme Nightbot est susceptible de publier des liens et faire des actions de modération il faut penser à mettre le bot comme modérateur /mod nightbot
Commandes modérateurs et streameur¶
Gérer les commandes personnalisées du chatbot Nightbot¶
Documentation officielle : https://docs.nightbot.tv/commands/commands
Ajouter/modifier/supprimer¶
!commands add !<commande> Message à afficher
!commands edit !<commande> Message à afficher
!commands delete !<commande>
Ajouter une commande avec permission (userlevel), cooldown et alias¶
Userlevel
UserLevel :
owner
- Channel Ownermoderator
- Channel Moderatortwitch_vip
- Twitch VIP (only for Twitch accounts)regular
- Nightbot Regular (users in the regulars list)subscriber
- Paid Channel Subscribereveryone
- Normal User (default)
Les variables utilisables dans les commandes¶
- Arguments : space separated arguments in the command's input
$(number)
avecnumber
entre 1 et 9- exemple :
!commands add !third $(3)
et!third lorem ipsum dolor
=>dolor
- Channel : name of the current channel
$(channel)
- exemple :
!commands add !followers $(channel) has $(twitch $(channel) "{{ followers }} followers!")
- ChannelID : id of the current channel
- ChatID : id of the current chat
- Count : variable that automatically increments
$(count)
: retourne 1 la première fois ou la dernière valeur + 1 lors des appels suivants- exemple :
!commands add !hug /me hugged $(touser) ($(count) hugs have been given)
- Countdown : time left until a specified time
- Countup : time past since a specified time
- DJKhaled : display one of DJ Khaled’s 🔑s to success
- Eval : evaluates JavaScript code
$(eval javascript)
- exemple :
$(eval 2 + 2)
=>4
- exemple :
!commands add !random The Random Number is: $(eval Math.floor((Math.random() * 100) + 1))
- exemple :
!commands add !8ball 🎱 $(eval const responses = ['All signs point to yes...', 'Yes!', 'My sources say nope.', 'You may rely on it.', 'Concentrate and ask again...', 'Outlook not so good...', 'It is decidedly so!', 'Better not tell you.', 'Very doubtful.', 'Yes - Definitely!', 'It is certain!', 'Most likely.', 'Ask again later.', 'No!', 'Outlook good.', 'Don\'t count on it.']; responses[Math.floor(Math.random() * responses.length)];)
- Lastfm : last scrobbled song from a Last.fm profile
- LeagueOfLegends : display rank information for a summoner name
- PSN – user stats from a Playstation Network profile
- Query : full input that comes after the command
- exemple :
!commands add !weather $(weather $(query))
(!weather Kappa
)
- exemple :
- QueryString : full input that comes after the command with url-encoding
- exemple :
$(querystring $(twitch $(channel) "{{ url }}"))
=>https%3A%2F%2Fwww.twitch.tv%2Fnight
- exemple :
- Rainwave : current song information from the Rainwave radio network
- Steam : user information from a Steam profile
$(steam username)
$(steam username "formatted string")
:name
: Currently set player namerealName
: User's real name (if one is set)profileUrl
: Link to the user's Steam community pagelastOnline
: The last time a user was online on Steamstatus
: The current status of the user (Online, Offline, Busy, Away, Snooze, Looking to play, Looking to trade)country
: The country the user resides in (if one is set)gameId
: The game ID of a Steam game being played (if one is being played)gameName
: The game being played (if one is being played)gameUrl
: The link to the game's Steam page (if a game is being played)gameServer
: The IP and port of the server being played on (if an eligible game is being played)
- exemple :
$(steam night "{{ name }} resides in {{ country }} - {{ profileUrl }}")
=>Night resides in US - http://steamcommunity.com/id/night/
- Time : current time in a selected timezone
$(time timezone)
$(time timezone "formatted time")
- exemple:
$(time US/Eastern "MMMM Do YYYY, h:mm:ss a z [GMT]Z")
=>December 8th 2015, 10:05:04 am EST GMT-05:00
- exemple:
- ToUser : first argument given to the command
$(touser)
- exemple :
!commands add !hug /me hugs $(touser)
- Tweet : Generate click-to-tweet templates with a specified message
$(tweet message)
- Twitch : user information from a Twitch profile
$(twitch username)
:username
is the Twitch user being looked up$(twitch username "formatted string")
:name
: usernamedisplayName
: display nameurl
: channel page linkstatus
: offline, live, or playing a playlisttitle
: stream titlegame
: stream gametags
: stream tagscreatedAt
: date/time user account was createdcreatedLength
: length of time user has been created (years, months, days, hours, minutes, seconds)viewers
: current number of live viewersviews
: current number of channel viewsfollowers
: current number of channel followersresolution
: stream resolution (if live)fps
: stream fps (if live)uptimeAt
: date/time user went live (or started playing a playlist)uptimeLength
: length of time user has been live (or started playing a playlist) (years, months, days, hours, minutes, seconds)subscriberCount
: the number of subscribers a channel has (only available when querying from the desired channel)
- exemple :
$(twitch night "{{ displayName }} has {{ followers }} followers")
- UrlFetch : output from a remote url
$(urlfetch url)
:url
is a URL that returns a body in plain text with less than 400 characters in its response
- User : name of the calling user
$(user)
- UserID : id of the calling user
$(userid)
- UserLevel : userlevel of the calling user
$(userlevel)
- Weather : weather information at a specified location
$(weather location)
- exemple :
$(weather Kappa)
=>Weather for Kappa, IL: Conditions are Overcast with a temperature of 37 F (3 C). The wind is blowing From the South at 15 MPH and the current humidity is 100%.
- XBL – user stats from an Xbox Live profile