Commit Graph

62 Commits

Author SHA1 Message Date
Alexander B
0475b38ae8
RoomGame: Refactor to use generic typing (#8678) 2022-03-13 18:01:54 -07:00
Mia
7811795344
Handle new TypeScript version (#8449)
Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2021-08-30 20:11:44 -07:00
Mia
cee7d8290c Youtube: Update TwitchStream display HTML
Requested by Felucia.
2021-07-15 23:43:12 -05:00
Guangcong Luo
26392b5be8 PM-convert |uhtml| and |uhtmlchange|
`|uhtml|` and `|uhtmlchange|` are now converted to `/uhtml` and
`/uhtmlchange` in PMs, like `|html|`. This should simplify stuff
in PMs going forward.
2021-05-11 20:46:26 -07:00
Mia
0b2f63b9f3 Info: Support twitch links in /show 2021-05-10 21:57:20 -05:00
Mia
518fccd921 Youtube: Allow Pokemon Go to use /twitch watch 2021-05-10 10:10:56 -05:00
Guangcong Luo
810aff74cd Namespace more server global types 2021-04-25 14:16:27 -07:00
Guangcong Luo
486f292904
Refactor everything to use Utils.sortBy (#8220)
A few uses of `array.sort()` have been left alone:

- sorting in `data/` because they aren't supposed to import anything

- `set-importer` because I still have no clue what that's for and what
  dependencies it is/isn't allowed to have

- `sort()` with no arguments used as a lexical sort (at which point
  `sortBy` offers no benefits)

All other cases have been replaced with `Utils.sortBy`, which should
be a massive increase in readability.

Sort orders should be much more readable now, without needing to puzzle
through sign issues. The order is always low-to-high, A-to-Z,
true-to-false.
2021-04-23 22:41:00 -07:00
Mia
6cccd0935a Revert /show and /requestshow to use <youtube> again 2021-02-27 22:33:13 -06:00
Annika
c2e97aaaed
Use optional chaining in more places (#8063) 2021-02-22 11:42:05 -08:00
Mia
4f0ff8cc96
Youtube: Support Twitch streams/channels (#8005) 2021-02-15 01:54:49 -08:00
Mia
13a2a802a1
YouTube: Add a command to disable the interval (#7984) 2021-02-02 11:11:54 -08:00
Mia
207d234260
Youtube: Notify room of starting groupwatches (#7980) 2021-02-01 12:07:40 -08:00
Mia
76c10841ea
Lib: Add an index file for all exports (#7972) 2021-01-31 18:00:19 -08:00
Mia
f6491e61ea
Youtube: Add a command to list groupwatches (#7964) 2021-01-30 22:57:02 -08:00
SirKira(!Uzumaki)
071cf40d30
Fix double box in YouTube channel display (#7861) 2021-01-19 09:03:07 -08:00
Mia
05295e356a
Modify uses of <youtube> tag to comply with API ToS (#7848) 2020-12-28 22:09:32 -08:00
Mia
981019e148
YouTube: Fix crash in interval (#7831) 2020-12-23 20:35:09 -08:00
Mia
14218b133d Youtube: Fix crash in /yt endwatch 2020-12-13 20:12:20 +00:00
Mia
3fb5f20321
Youtube: Track current video time in groupwatch (#7767) 2020-12-11 11:39:23 +04:00
Guangcong Luo
cc1acbb934 Fix build error from merging conflicting PRs 2020-12-01 15:16:02 +00:00
Mia
e942ed1f56
Youtube: Add support for watching videos as a group (#7732) 2020-12-01 06:53:59 -08:00
Mia
23615e5ce0
Youtube: Make /show show videos directly in chat (#7725) 2020-11-24 10:14:04 -08:00
Mia
f03cae8360
Youtube: Update category command permissions (#7668) 2020-11-11 19:41:38 -08:00
Mia
251f801210
Studio: Only request YT video data once (#7595) 2020-10-29 08:31:54 -07:00
Mia
34db61539e
Youtube: Cache requested video data (#7593) 2020-10-27 14:11:30 -07:00
Mia
6c825ad198
Youtube: Properly check permissions (#7590) 2020-10-27 10:52:29 -04:00
Kris Johnson
57e3d7c185
Add The Studio chat plugin (#7542) 2020-10-24 14:09:43 -07:00
Mia
c6aa139f62
Youtube: Persist interval time (#7550) 2020-10-21 05:37:02 -07:00
Mia
ef6cad7c9d
CommandContext: Make requireRoom support specifying a room (#7549) 2020-10-21 04:21:42 -07:00
Mia
e7cf8a23c9
COTW: Support saving channel data of winning channels (#7535) 2020-10-20 05:48:24 -07:00
Guangcong Luo
9d87616176
Add more style linting rules (#7537)
* Lint arrow-body-style

* Lint prefer-object-spread

Object spread is faster _and_ more readable.

This also fixes a few unnecessary object clones.

* Enable no-parameter-properties

This isn't currently used, but this makes clear that it shouldn't be.

* Refactor more Promises to async/await

* Remove unnecessary code from getDataMoveHTML etc

* Lint prefer-string-starts-ends-with

* Stop using no-undef

According to the typescript-eslint FAQ, this is redundant with
TypeScript, and they're not wrong. This will save us from needing to
specify globals in two different places which will be nice.
2020-10-19 02:42:28 -07:00
Mia
918d436ac0
Youtube: Move video data fetching to a different function (#7536) 2020-10-19 02:18:44 -07:00
Mia
d020a2f921
Youtube: Support searching for videos (#7529) 2020-10-17 02:52:04 -07:00
Mia
ca3e7237d7
Youtube: Support channel categories (#7509) 2020-10-11 13:44:42 -07:00
Mia
896793c010
Youtube: Update channel url handling (#7482) 2020-10-06 16:00:16 -07:00
Mia
4279d1f3bc
Update attributions in various locations (#7354) 2020-10-06 15:55:26 -07:00
Mia
62bcce1d55 Plugins: Don't try-catch ENOENT errors when using FS.readIfExists() 2020-09-26 23:02:45 -05:00
Mia
44fc0123ad
Chat: Refactor CommandContext and PageContext to use ErrorMessage more (#7234) 2020-09-06 00:15:16 -07:00
Mia
42ba4b87d2
Youtube: Fix crash (#7280) 2020-08-31 06:45:35 -07:00
Mia
fbe5d90dd0
Youtube: Add tests (#7081) 2020-08-06 00:34:18 -07:00
Lusamine
3a2ca90040
Minor cleanup of global demotion messages (#7011) 2020-07-17 01:17:36 -07:00
Guangcong Luo
c124720885
Support throwing error messages (#6946)
The idea is that throwing `ErrorMessage` will replace needing to pass
`context` variables around (which make it hard to unit test a lot of
chat functions).

I recognize the drawback is that it makes it harder to tell where
chat commands might return from. This might be somewhat alleviated by
a convention such as prefixing everything with `check`

    this.checkBroadcastable();

    this.checkCan('lock');

I honestly didn't like the old approach of `if (!this.can(...)) return`,
though. It didn't seem very obvious which commands would show error
messages and which needed you to write your own error messages. I think
the new system would at least be clearer about that.

We can also consider things such as some sort of sigil, such as:

    !this.checkCan('lock');

There's no other reason to use `!` at the beginning of a line, so I
think this is reasonably unambiguous, although it might take some
time to learn. Also we'd have to screw with eslint.

Another alternative is something all-caps?

    this.CHECK_can('lock');

In the end, I still think `this.checkCan('lock')` would be enough, and
I still think it's already an improvement in many ways.
2020-07-06 14:07:02 -07:00
Mia
4997a47314
Commands: Allow the room parameter to be null (#6948)
Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2020-07-05 14:25:09 -07:00
Guangcong Luo
d7ba455e2b Update permissions
Permissions have gotten out-of-date, so this commit syncs them.
Default permissions are now matched with Main, in particular including
the new & rank as admin (removing the old Leader rank and ~ symbol).

Relevant changes:
- Admin (~) and Leader (&) have been merged into Admin (&)
- The 'ban' permission was split into 'globalban' and 'ban'
- The 'broadcast' permission was renamed 'show' (going forward,
  "broadcast" should only refer to the big red/blue/green
  announcement bars.)
- Bots no longer have global moderation abilities, making it
  easier to give untrustworthy bots the "bot" rank.
2020-07-03 17:32:49 -04:00
Guangcong Luo
bdb0b0ff72 Refactor Net use in YouTube plugin 2020-07-02 17:14:24 -07:00
Mia
857d5c648e
Youtube: Allow drivers to use /youtube update (#6933) 2020-06-30 12:11:09 -07:00
Guangcong Luo
6af875af8b Improve RoomPermission/GlobalPermission checks
Global permissions can no longer be used as room permissions. Instead,
the two are entirely separate lists, with only a few permissions in
both lists.
2020-06-21 03:53:06 -07:00
Mia
f306ed069f
Youtube: Fix crash (#6891)
Ensure video data exists in the response
2020-06-20 20:47:55 -07:00
Mia
a888c10bb6
Youtube: Don't crash if key isn't configured (#6848) 2020-06-20 20:16:07 -07:00