Commit Graph

37 Commits

Author SHA1 Message Date
panpawn
c93ad6a29b Studio: Remove period from modnote on sotd (#2878) 2016-11-06 01:23:44 +01:00
panpawn
157d419c1a Studio: Add Song of the Day functionality (#2848)
Requested by #Don't Lose

This also fixes the check for it a user can talk in the set command to be the same check throughout PS.

This also fixes escaping HTML for the set artist in two specific instances.
2016-10-26 18:57:59 -05:00
panpawn
76285471a0 Fix double errorReply while muted in some cases (#2830)
Due to the recent refactor that changed how `this.canTalk` works, if a user was muted in a room, and then tried to do a command that wasn't allowed to be used if they can't talk, it would send two replies: "You are muted and cannot talk in this room." AND "You cannot do this while unable to talk."

This makes it so that if you're using a command while muted that isn't allowed to be used if you can't talk, it will just use the "You are muted and cannot talk in this room." errorReply.
2016-10-08 20:58:16 -07:00
Guangcong Luo
d6f5404e7e Rename CommandParser to Chat
We had a lot of discussion in Dev and a somewhat-close poll, but in
the end "Chat" was a better name than "Messages", and also has the
advantage of being shorter (which is nice for Chat.html and
Chat.plural which should be short).
2016-09-30 18:31:15 -07:00
Guangcong Luo
da1b318707 Move text processing from Tools to CommandParser
The following functions have been renamed:

- Tools.html to CommandParser.html
- Tools.plural to CommandParser.plural
- Tools.escapeHTML to CommandParser.escapeHTML
- Tools.toDurationString to CommandParser.toDurationString
- Tools.toTimeStamp to CommandParser.toTimestamp
  (notice the lowercase 's')

This is in preparation for a rename of Tools to Dex (by removing the
non-dex-related functions) and a rename of CommandParser to either
Messages or Chat.
2016-09-30 18:04:13 -07:00
panpawn
36d7728b06 Update help commands to reflect new bot rank (#2634)
Also, give the bot rank the new addhtml permission in config/config-example.js

... And, we are going to fix promoting locked users to rank bot.
2016-07-20 19:50:47 -06:00
Guangcong Luo
4a995350bb Shim Array#includes
This also refactors everything to use Array#includes except data
and mods, which are large enough that I'll refactor them later
probably.
2016-05-04 02:55:18 -07:00
Ivo Julca
c190b006b7 Replace explicit iterable protocol usage by for-of loops 2016-04-25 21:41:35 -05:00
Quinton Lee
2b620f1c41 The Studio plugin: fix state importing 2016-04-07 20:16:36 -05:00
Ivo Julca
10bb83bf3c Improvements to command broadcast API
- Method `this.runBroadcast()` has been split from `this.canBroadcast()`.
It's now the only method handling command-usage and intended as the main API
for synchronous commands. Async commands will execute both separately.
Note that the `suppressMessage` parameter is now passed to `runBroadcast`.

- The semantics of `broadcasting` have been similarly split.
`this,broadcastMessage` will be set to a truthy value when `this.canBroadcast` is run.
`this,broadcasting` will only be set to `true` once `this.runBroadcast` is executed.
2016-04-02 15:46:13 -05:00
Ivo Julca
3cd1217f18 TheStudio: replace usage of toArrayOfArrays by Array.from 2016-03-22 21:20:10 -05:00
Quinton Lee
ed36908033 The Studio plugin: update /aotd quote
It can now be used by drivers+.
2016-02-24 22:51:42 -06:00
Guangcong Luo
b665660608 Refactor for more ES6 features
Now that nodejs/node#3072 is mostly fixed, we can finally start using
Node 4+ features.

This refactor:

- uses arrow functions where appropriate

  Note that arrow functions still aren't used in Mocha, where `this`
  is sometimes meaningful.

  This also removes the need for .bind() nearly everywhere, as well
  as the `self = this` trick.

- refactors Validator and Connection into ES6 classes

- no longer uses Array#forEach for iterating arrays

  We strongly prefer for (let i = 0; i < arr.length; i++) because of
  performance reasons. Most forEaches have been replaced with for..of,
  though, which is 5x slower than the long-form loop but 2x faster
  than forEach, which is good enough outside of most inner loops.

  The only exception is tournaments, which is due for a more invasive
  refactor soon anyway.
2016-02-10 17:40:21 -06:00
Konrad Borowski
81f602b8d8 Always use trailing comma for multiline objects 2016-01-01 00:20:07 +01:00
Ivo Julca
b63c0ed847 The Studio plugin: fix sorting of results in /aotd viewnoms 2015-12-20 03:41:09 -05:00
panpawn
fe7385395e The Studio plugin: list nominations alphabetically
And also state the number of prenoms as well
2015-12-12 01:47:22 +00:00
panpawn
0cc95c737e The Studio plugin: show number of noms in viewnoms
(Permission from RO Amingo)
2015-11-26 16:12:18 -05:00
Quinton Lee
a809b16a24 The Studio plugin: update /aotd quote permission 2015-11-23 19:26:50 -06:00
panpawn
6727d87808 Standardize canTalk() permission in chat-plugins 2015-11-23 16:06:12 +00:00
Ivo Julca
9a52fe337f Parse all numerical user input as base 10
Also took the chance to commit some style fixes missed in 90973d5 and 04c64c1.
2015-11-07 20:08:01 -05:00
Juanma Serrano
c4ac8d6e2f Use strict mode and let and const instead of var
This commit also fixes some duplicated variable declarations.
2015-11-06 21:56:52 -05:00
Bryan AA
45ab344144 Replace 'this.sendReply' with 'this.errorReply' in some cases 2015-09-27 19:16:39 -06:00
Quinton Lee
4d40342000 The Studio plugin: add /aotd quote to /help aotd 2015-09-19 15:52:56 -05:00
sirDonovan
6d3838dfa0 The Studio plugin: add /aotd quote 2015-09-14 22:58:30 -05:00
Bryan AA
a6a57c6e5c Add "this.parse" on thestudio.js commands and fix /demote command 2015-06-19 13:04:00 -06:00
Bryan AA
b57fb88123 Add a reply if someone use a command of thestudio.js in other room 2015-06-18 14:49:20 -06:00
sirDonovan
3bb410f0d1 Fix crashes in chat plugins
The old mute system was still in place, updated to reflect changes from
09be77d0b8
2015-06-16 17:56:07 -05:00
Morfent
882e9369f2 Chat plugins: AotD and Trivia bug fixes
- Remove question sorting on loading the Trivia plugin, since it is no
  longer required
- Trivia game winners are chosen based on who answers first, not who
  signs up first
- The Artist of the Day is no longer always the first artist to be
  submitted
- Replace instances of foo > -1 with foo >= 0
2015-05-18 18:38:29 -03:00
Morfent
062f56ddd2 Chat plugins: mute/lock checks, add remaining help docs...
Letting users that can't talk use the more important commands is fine
and all, until they find a way to spam with them.

- Remove redundant this.canBroadcast call in /aotd
- The response after changing the Quote of the Day uses the proper
  broadcast style
- /aotd viewnoms sorts the prenomination list
- /trivia qs acknowledges that Video Games is a category
- Change suggestions to use the deprecated /trivia help command to /help
  trivia
- Add style fixes used in the Trivia to the The Happy Place and The Studio
  plugins
2015-05-05 22:43:33 -03:00
sirDonovan
376406aadd The Studio plugin: fix crashes and nominations 2015-04-14 02:29:36 -05:00
Morfent
3fd7efebf1 The Studio plugin: fix /aotd end 2015-04-11 22:49:28 -03:00
Ivo Julca
f6146b1a6d Plugin AotD: support io.js without es6-shim 2015-04-11 20:38:12 -05:00
Morfent
552c123f9c The Studio plugin: separate response for changing nominations 2015-03-05 21:27:17 -04:00
Morfent
c083764bc9 The Studio plugin: implement prenominations 2015-03-03 05:16:26 -04:00
Morfent
098c1d7caf The Studio plugin: overhaul nomination commands
The plugin can now manage nominations on its own instead of not doing
much more than broadcasting HTML, and the Artist of the Day survives
hotpatching and server restarts.
2015-03-01 17:54:49 -04:00
Guangcong Luo
12b673bb49 Fix style errors; update gulpfile
I used a hack to make the multiple declaration errors go away,
so all that remained in jsHint were actual errors, which I've
now mostly fixed.

All this linting ended up uncovering one actual bug: Uproar's
message not showing. It's a very minor bug in a move no one uses,
so I'm going to fold it into this commit.
2014-08-10 18:06:44 -04:00
小太
a2bfb57bfe Move chat plugins to their own directory 2014-08-04 18:33:52 +10:00