Commit Graph

1048 Commits

Author SHA1 Message Date
Guangcong Luo
810aff74cd Namespace more server global types 2021-04-25 14:16:27 -07:00
Guangcong Luo
0e0389bdc8 Rename pageContext.send to pageContext.setHTML
It's currently not very similar to commandContext.send so using the
same name could make things very confusing.

We have a new `pageContext.send` function that actually behaves as
you'd expect.
2021-04-25 13:25:42 -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
d992b8f5fa
Add more support for custom punishments (#8215) 2021-04-23 22:40:31 -07:00
Kris Johnson
a1bdafbfe8
Add room sections (#8205) 2021-04-23 22:39:56 -07:00
Annika
909d4657f4 Trivia: Further clarify typing 2021-04-22 12:38:33 -07:00
Annika
df16828aaf Trivia: Fix typing for TriviaLadder 2021-04-22 12:10:13 -07:00
Mia
5586484622 Hosts: Fix crash 2021-04-22 11:41:16 -05:00
Annika
0e21aebfab Trivia: Improve display for unranked games 2021-04-21 20:27:16 -07:00
Mia
e9b1bfe5f0 Chat-monitor: Fix /filter help
(CommandContext#run does not work for help commands that are arrays)
2021-04-21 08:30:19 -05:00
Annika
d5a4c7d9e2 CommandContext#globalModlog: Make user optional
Global modlog entries aren't always acting on a user, so making this parameter optional makes sense. I also changed them to default to null for consistency with CommandContext#modlog.
2021-04-19 08:53:17 -07:00
Kris Johnson
f4fda49201 Update Battle Factory tests and command 2021-04-16 17:35:26 -06:00
Kris Johnson
e9e58c9f99 Dexsearch: Fix bug with mod parameters 2021-04-15 16:44:44 -06:00
Mia
5ed9517c84 Polls: Increase max question limit 2021-04-15 12:11:33 -05:00
PartMan
54ebe56f20
Scavengers: Escape usernames in /scav status (#8201) 2021-04-15 15:46:43 +02:00
Kris Johnson
a0c3f105b2
Add /filter test (#8197) 2021-04-14 10:15:25 -07:00
Distrib
334df4a744
Announcements: Fix /announcement htmlcreate (#8194) 2021-04-13 14:00:48 -07:00
Mia
1d494b6f2d RPS: Fix bugs with matchups and lower round cap 2021-04-12 10:40:31 -05:00
Leonard Craft III
d1e863b584
Help Tickets: Add cheating report type (#8190) 2021-04-10 01:14:04 -07:00
Annika L
583dceb693 Chat monitor: Weeklock for slurs in Pokemon nicknames 2021-04-08 22:18:38 -07:00
Mia
6605e1e1b7 Autoresponder: Correctly format newlines in FAQs and improve style 2021-04-08 10:04:17 -05:00
Guangcong Luo
5233559183 Refactor Dex types 2021-04-08 07:08:56 -07:00
Guangcong Luo
13189fdb02
Update Dex API (#8181)
This is the change that renames:

- `Dex.getMove` -> `Dex.moves.get`
- `Dex.getAbility` -> `Dex.abilities.get`
- `Dex.getItem` -> `Dex.items.get`
- `Dex.getSpecies` -> `Dex.species.get`
- `Dex.getEffect` -> `Dex.conditions.get`
- `Dex.getNature` -> `Dex.natures.get`
- `Dex.getType` -> `Dex.types.get`
- `Dex.getFormat` -> `Dex.formats.get`

In addition, some other APIs have been updated:

- `getByID` methods have also been added to every other table.
- `Dex.moves.all()` now gets an array of all moves
  - Plus equivalent methods for `abilities`, `items`, `species`, `formats`, `natures`, `types`
  - Note: there's no `Dex.conditions.all()`
- new API: `Dex.stats` for naming/iterating stats
- `Dex.getEffectByID` -> `Dex.conditions.getByID`
- `Dex.getType` -> `Dex.types.get`
- `Dex.data.Formats` -> `Dex.data.Rulesets`
- `Dex.formats` -> now an array `Dex.formats.all()`
- `Dex.getRuleTable` -> `Dex.formats.getRuleTable`
- `Dex.validateFormat` -> `Dex.formats.validate`

Team functions have been split off into a new `sim/teams` package:

- `Dex.packTeam` -> `Teams.pack`
- `Dex.fastUnpackTeam` -> `Teams.unpack`
- `Dex.generateTeam` -> `Teams.generate`
- `Dex.stringifyTeam` -> `Teams.export`

`Teams.export` has also been rewritten to better match how it works in client.

This implements #8178
2021-04-08 03:00:37 -07:00
Annika
6806b8c3ac Chat monitor: Weeklock for slur evasion 2021-04-06 12:42:42 -07:00
Mia
7ea8cfa668 TOTD: Fix keys[0] not being the nom 2021-04-06 11:58:02 -05:00
Mia
708d81efde OTD: Fix double timestamp display 2021-04-06 11:50:28 -05:00
Mia
4ec9db3489 TOTD: Fix timestamp display and ensure timestamp always exists 2021-04-05 16:01:48 -05:00
Mia
c506b2118c Hangman: Fix caps sensitivity in /hangman untag 2021-04-05 11:25:28 -05:00
Annika
f43795880c Repeats: Ensure repeat IDs aren't empty strings 2021-04-03 18:04:52 -07:00
Mia
46dc3409b6
Helptickets: Notify users of /faq proxy when opening an IP-appeal ticket (#8132) 2021-04-02 22:29:14 -04:00
siteworks
d887c00795
Mafia: Change lynches to vote in the votebox (#8149) 2021-04-02 18:52:13 -04:00
Mia
294e3a4a57
Chat monitor: Refactor to handle private filters better (#8112) 2021-04-01 15:35:37 -07:00
Guangcong Luo
c6edf9389f Minor refactor to RPS code 2021-04-01 15:07:27 -07:00
Mia
4bfbd1b78d Fix build 2021-04-01 10:27:23 -05:00
Mia
f19f464ea7 Chat: Properly remove old data for some onRename handlers 2021-04-01 00:24:54 -05:00
Mia
b7680c783d
Add infrastructure to rename chat plugin data with rooms (#8153) 2021-04-01 01:23:01 -04:00
Mia
a353e9ab43 Hangman: Fix case insensitivity in /hangman addtag 2021-03-29 21:11:00 -05:00
PartMan
fb51d2d769
Scavengers: Make !scav queue broadcastable (#8131) 2021-03-26 19:23:04 -07:00
Annika
ca9d8d31a8 Fix visual glitch in /randbats in Gen 1 2021-03-26 08:53:49 -07:00
Annika
af8b286d2c Mastermind: Fix leaderboard bug and add aliases 2021-03-25 13:32:00 -07:00
Mia
4f31d369f5 Add an easy way to disable battlesearching commands 2021-03-25 12:24:12 -05:00
Mia
0c849570d2
Hangman: Support tagging premade phrases (#8133) 2021-03-24 16:10:33 -07:00
Kris Johnson
2e4eaf97e7 Announcements: Mark formatted text as trusted 2021-03-23 12:47:40 -06:00
Kris Johnson
dbc75a0ed5 UNO: Add a missing space when listing players 2021-03-23 02:37:16 -06:00
Mia
b21def4e91
Help tickets: Refresh /ht list on ticket update (#8113) 2021-03-22 15:55:58 -07:00
Mia
a15268f9c1 Helptickets: Remove extraneous 'month' from staff stats page 2021-03-22 13:31:42 -05:00
Distrib
0bd9f47324
Datasearch: Improve dexsearchhelp & movesearchhelp (#8066) 2021-03-21 18:42:04 -07:00
Annika
c1fa436e35 Trivia: Implement a /trivia unrankednew command
This enables the creation of Trivia officials that do not reward points.
2021-03-20 12:30:46 -07:00
Annika
6ecf74fa55 /randbats: Don't display Gmax sets in old gens 2021-03-20 12:30:46 -07:00
Annika
1a8e65bbd9 Improve the /randbats command for Gmax sets 2021-03-19 20:48:57 -07:00