Commit Graph

184 Commits

Author SHA1 Message Date
Mia
d045890884
/show: Throttle requests (#7589) 2020-10-27 23:02:02 +04:00
Annika
99dce89cc6
Fix behavior of /faq with no arguments 2020-10-26 14:52:02 -07:00
Kris Johnson
57e3d7c185
Add The Studio chat plugin (#7542) 2020-10-24 14:09:43 -07:00
Mia
7da1bdeab9
Remove /roomwhitelist from /roomhelp (#7547) 2020-10-21 03:15:18 -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
4620068159
Chat commands: make /addrankuhtml multiline (#7480) 2020-10-06 15:23:14 -07:00
Mia
01c3e0e3ef
Add a command to view the registration time of a user (#7366) 2020-10-06 11:47:12 -07:00
PartMan
fa5456deca
Make !groups case-insensitive (#7475) 2020-10-05 14:22:20 -07:00
Annika
3fcb8f4e00
Use attributes of CommandContext in Chat.filter (#7461) 2020-10-03 21:30:20 -07:00
Annika
d807e00e40
Helptickets: Display shared battles in staffintro (#7460) 2020-10-02 19:24:29 -07:00
Annika
1c4b57b56c
Use translated German website pages (#7440) 2020-09-30 12:32:56 -07:00
Annika
5bad212da8
Apply chatfilters to !code (#7442) 2020-09-30 10:32:27 -07:00
PartMan
6cb31fe2a6
Fix Flooring in /statcalc (#7420) 2020-09-27 06:56:58 -07:00
Mia
78933408bf
Quotes: Move to a chat plugin (#7421) 2020-09-26 08:11:42 -07:00
Mia
3352e11b86
Add the alias /profile to /whois (#7422) 2020-09-26 02:28:11 -07:00
Marcell
d2bb6a8089
Make Prize Winner bold (#7416)
I removed the "/" from the first tag, so it will be displayed as bold.
2020-09-25 00:28:08 +04:00
Mia
8bbec3db3a
Add prize winner to /groups (#7407) 2020-09-22 18:18:52 -07:00
urkerab
fbef450802
Fix missing variable renames after PR #6670 (#7400) 2020-09-19 17:59:40 -07:00
Mia
fdd264d075
Quotes: Properly check if a user can view the room (#7397) 2020-09-19 16:03:00 -07:00
Annika
ab7daeecf8
Mention PHP in /opensource (#7391) 2020-09-18 20:37:57 -07:00
Mia
9a555a6ee9
Add weekban to /punishments (#7388) 2020-09-18 16:19:43 -07:00
Kris Johnson
d7adf0e17c
Quotes: Make deleting quotes log properly 2020-09-17 20:36:51 -06:00
Mia
abad806760
Improve the /faq command (#7369) 2020-09-16 01:25:34 -07:00
Kris Johnson
df9a4488fa
Quotes: Quality-of-life changes and bug fixes (#7361) 2020-09-15 03:32:08 -07:00
Mia
8be5ccb235
Quotes: Fix bug in attribution (#7360) 2020-09-12 19:45:56 -07:00
Mia
e1b91066c3
Support adding quotes in rooms (#7352) 2020-09-11 13:44:14 -07:00
Mia
44fc0123ad
Chat: Refactor CommandContext and PageContext to use ErrorMessage more (#7234) 2020-09-06 00:15:16 -07:00
Annika
13d1a4fa6d
Allow users to see their own hidden games in /whois (#7315) 2020-09-05 13:57:54 -07:00
Kirk Scheibelhut
afdbcd355e Update credits 2020-09-03 13:29:41 -07:00
TheMezStrikes
94b3e6f96f
Update CAP samples link to gen 8 (#7288) 2020-09-01 02:26:30 +04:00
Annika
c9fa3fc389
Refactor User#prevNames and User#ips to arrays (#7267) 2020-08-29 10:27:03 -07:00
Guangcong Luo
e14485656f Implement a basic /hiderank
This doesn't really have any nice-to-have automatic restoration
features but it should be all the important parts.

`user.group` no longer exists, and has been replaced with
`user.tempGroup`, which now applies both to temporary promotions of
unregistered users, as well as temporary hidden ranks of auth.
2020-08-22 07:20:26 -07:00
Guangcong Luo
2878793964 Revert accidental merge of /hiderank code
`/hiderank` code was accidentally merged into #7078

This fully backs out its code.
2020-08-22 06:57:24 -07:00
Mia
2561764bdc
Make /requestshow approvals staffintro look nicer (#7233) 2020-08-20 21:35:05 -07:00
Spandan Punwatkar
7f0450673d
Add support for inverse in /weak (#7198) 2020-08-19 13:04:28 -07:00
Annika
8de5027703
Fix HTML tag in /faq (#7230) 2020-08-19 00:46:03 -07:00
Annika
3197a53b53
Make the !faq command translatable (#7149) 2020-08-16 11:26:29 -07:00
Annika
49e9d8adda
Display G-Max moves properly in /details (#7117) 2020-08-15 17:57:27 -07:00
Kris Johnson
7fc3cd516e
Add /nomarkshared (#7201) 2020-08-12 16:21:00 -07:00
Kris Johnson
8ba03fa10b
Fix crash with /dt (#7199) 2020-08-12 08:34:04 -07:00
Guangcong Luo
873efe91ce Refactor extractRoom to requireRoom
New in PageContext as of 9b3a986ef4ef7:

`extractRoom` no longer shows an error message if the room isn't found.
Instead, `requireRoom` does that.
2020-08-06 00:54:02 -07:00
Annika
04961fcbb8
Add short alias for /sharedbattles (#7150)
This was requested in Staff room a few days back but I forgot about it until now.
2020-08-05 04:32:55 -07:00
Spandan Punwatkar
fdea3aca28
Add /battlerules (#7029) 2020-07-31 18:06:19 -07:00
Quinton Lee
a8b3da922a
Allow bots to use !checkchallenges again (#7098) 2020-07-31 14:44:57 -07:00
Annika
05a9f9a1e5
Minor code quality improvements based on LGTM (#7092) 2020-07-30 14:24:37 -07:00
Annika
cd85cd7a9d
Hosts & IPTools: Refactor to remove hardcoded ranges (#7078) 2020-07-29 23:04:50 -07:00
Kris Johnson
70edfaa64c
Add support for more OMs (#7084) 2020-07-30 05:22:21 +04:00
Guangcong Luo
fe2eb27860
Refactor ip and modchat permissions (#7076)
- `ip` and `ipself` are now separate permissions. This means that `ip`
  is now a generalized permission for viewing IPs (no more need to use
  `globalban`, since `ipself` now controls the ability to see your own
  IP address)

- `alts` and `altsself` are now also separate (all users used to be
  able to `altsself`).

- `modchat`, `modchatall`, and `manageroom` are now just one `modchat`
  permission whose jurisdiction controls how high you can set modchat.
2020-07-29 00:38:52 -07:00
Kris Johnson
00b88b521d
Handle Gigantamaxing properly (#7001) 2020-07-23 13:27:42 -07:00
Peach
e9611b7ce2
Remove unnecessary references to the global room (#7033) 2020-07-22 08:52:46 -07:00
Lusamine
3a2ca90040
Minor cleanup of global demotion messages (#7011) 2020-07-17 01:17:36 -07:00
TheMezStrikes
a719c5f7e3
Trim !show image comment (#6987) 2020-07-09 16:08:51 -07:00
Kris Johnson
1a9d0611a6
Add quality-of-life fixes for Pet Mods (#6968) 2020-07-06 16:44:09 -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
46c9afa2f3
"Remove" the global room (#6885)
I couldn't completely remove the global room in one commit, but this
solves basically every problem with it by making it no longer a `Room`.

In particular, this means:

- It's no longer of type `Room`
- It's no longer in the `Rooms.rooms` table
- Its class name is now `GlobalRoomState` rather than `GlobalRoom`
- It no longer tracks its own user list (online user count is now
  provided by `Users.onlineCount`)
- It's no longer a socket channel (there's new syntax for "send this
  message to every user")
2020-07-02 11:31:34 -07:00
Guangcong Luo
d20a4a9918 Remove unnecessary update in /requestshow 2020-07-01 16:37:36 -07:00
Mia
5d72fe2f74
Fix /viewapprovals (#6935) 2020-06-30 23:17:24 -07:00
Mia
75f9937aad
Info: Support viewing current media requests and hiding media (#6907) 2020-06-30 15:59:52 -07:00
TheMezStrikes
a3c0d69b3c
Add /st as /servertime alias (#6911) 2020-06-24 05:31:07 -07:00
urkerab
273eb928cf
Show status immunities in /weak output (#6889) 2020-06-20 20:49:50 -07:00
Guangcong Luo
20336fdfa0 Refactor /requestshow 2020-06-18 23:47:39 -07:00
Mia
501f773204
Improve /requestshow (#6868) 2020-06-18 23:43:41 -07:00
Mia
d2b255b934
/eval: Log in dev room and broadcast (#6871)
Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2020-06-18 23:28:15 -07:00
Guangcong Luo
ba53a2831c Fix bugs in /show
- Chat.getImageDimensions and Chat.fitImage now throw if passed things
  that aren't image URLs.
- Fix help message if you use /show by itself
- Link to full aize image if image is shrunk
2020-06-17 21:11:52 -04:00
Charlie Kobayashi
e51c4ce290
Fix minor issues with /show commands (#6849) 2020-06-16 20:12:34 -07:00
Guangcong Luo
32b5b43244 Fix unexcaped URI in /requestshow 2020-06-16 18:44:23 -07:00
Mia
6c97866f83
Add commands to show media in chat (#6745) 2020-06-16 14:40:10 -07:00
Kris Johnson
3228f91fbc
Fix uncommon evolution methods (#6830) 2020-06-13 12:46:21 -07:00
Mia
6839a1f4db
Add a library for utility functions (#6817) 2020-06-09 22:06:43 -07:00
Mia
15fed24b40
Refactor auth and room.settings (#6777)
This implements two big changes:

- All settings shared between `room.chatRoomData` and `room` have been
  merged into `room.settings` (so, for instance, `room.slowchat` is now
  only `room.settings.slowchat`).

  This makes it so we never have to worry about them getting "out of
  sync".

  - Checking to see if a room is persistent is now `if (room.persist)`
    instead of `if (room.chatRoomData)`

  - `Rooms.global.writeChatRoomData()` is now rarely called directly;
    there's a new `room.saveSettings()` which will handle it for you.

  - All properties of `room.settings` are now optional (except
    `title`).

- There's a new file `user-groups.ts` which handles authority.

  - `room.auth` and `Users.globalAuth` are now
    `Auth extends Map<ID, GroupSymbol>` objects.

  - `room.auth` is now always defined, removing the need for
    `room.auth?.[userid]` workarounds.

  - A lot of code relating to usergroups and permission checks have
    been refactored.

Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2020-06-09 08:22:25 -07:00
Annika
406eaed520
Add /dt(gen) as an alias to use /details for a gen (#6806) 2020-06-08 12:39:20 -07:00
Annika
f4863a9444
Update references to Global Administrators post-flattening (#6815)
Co-authored-by: Charlie Kobayashi <sparkychildcharlie@gmail.com>
2020-06-08 09:41:03 -07:00
DeltaCoderr
0c88586a7d
Make /pi command broadcastable (#6796) 2020-06-03 08:51:03 -07:00
Annika
54ee5e4444
Add more move target types to /details (#6756) 2020-05-29 16:59:06 -07:00
PartMan
c3def9cdff
Fix Effectiveness showing undefined (#6733)
(change .species => .name)
2020-05-23 12:18:40 -07:00
AnnikaCodes
e7d72ba4e8
Add more information to /faq autoconfirmed (#6696) 2020-05-17 07:35:27 -07:00
Guangcong Luo
78a29656ac Fix /data defaulting to numbers instead of tiers
Fixes #6700
2020-05-16 10:58:31 -04:00
Guangcong Luo
1d6d8f73da Refactor HTML validator
Mostly, extraneous `<` tags are now correctly detected, with a better tag tokenizer.
I also removed the separate passes for <img> and <button> validation.

Fixes #6685

Thanks PartMan for contributing some ideas.
2020-05-16 10:51:45 -04:00
Kris Johnson
2a642afac9
Support changing /data's tier in /roomsettings (#6675) 2020-05-15 18:55:09 -07:00
HoeenHero
a1916a2919 Fix /statcalc 2020-05-14 17:11:17 -04:00
AnnikaCodes
ca45d16cd2
Update links in /intro for Gen 8 (#6678) 2020-05-14 20:00:55 +04:00
Kris Johnson
d20f1fbb64
Typescript info (#6670) 2020-05-11 03:08:33 -07:00