TypeRacerStats is a Discord bot with 40+ commands to provide extensive TypeRacer statistics and features for users to improve typing speed.
TypeRacerStats
TypeRacerStats is a Discord bot partnered with with TypeRacer and was made with the Discord.py API wrapper, TypeRacer APIs, TypeRacerData APIs, SQLite, and various Python libraries (can be found in requirements.txt). It comes with over 40 commands to provide extensive statistics and features for users. Many of them are designed to help with improvement on the site. Run -help or refer to the commands section below.
Commands
Some commands are
, which means they provide statistics regardless of the TypeRacer universe—separate environments of TypeRacer with distinct texts, leaderboards, and scores—selected.
Another feature that some commands have is the ability to
your Discord account to a TypeRacer account; for commands with said feature, linked users will not have to type their TypeRacer username every time. This can be done using the -link [typeracer_username] command.
Finally, some commands' functionalities are limited according to the bot permissions a user has: regular, bot admin, or bot owner.
Info
Info commands provide information for the bot.
| Name |
Example |
Function |
Aliases |
-help [command] |
View |
Returns information for given command. Case sensitive and aliases may be used in place of [command]. |
h |
-info |
View |
Returns information about the bot. |
abt, about |
-invite |
View |
Returns an invite link for the bot. Refer to the Invite/Permissions section below for permissions. |
None |
-donate |
View |
Returns donation link to support the bot. |
support |
|
|
|
|
Configuration
Configuration commands allow server admins to change the bot's prefix and users to configure the settings of their Discord account with regards to the bot.
| Name |
Example |
Function |
Aliases |
-changeprefix [prefix] |
View |
Changes the bot's prefix on the server. |
cp |
-register [typeracer_username] |
View |
Links Discord account to TypeRacer account.  |
link, link* |
-setuniverse [universe] |
View |
Links Discord account to provided TypeRacer universe; defaults to play universe.  |
su |
-toggledessle |
View |
Toggles Desslejusted option for realspeed, lastrace, realspeedaverage, and raw.  |
td |
|
|
|
|
Basic
Basic commands do not require a user's information to be downloaded to provide statistics.
| Name |
Example |
Function |
Aliases |
-stats [user] |
View |
Returns basic stats for given user.  |
prof, profile |
-getdata [user] |
View |
Downloads given user's data; Advanced commands may be used after.  |
dl, gd, download, |
-today [user] <date> |
View |
Downloads given user's data for specified date. yesterday, yday, yd are special aliases.  |
day, yesterday, yday, yd |
-realspeed [user] <race_num> or -realspeed [url] |
View |
Returns realspeeds for given race.  |
rs |
-realspeedaverage [user] <first_race> <last_race> |
View |
Returns the realspeed average for given race interval.
may request up to 150 races.  |
rsa, rsa* |
-raw [user] <race_num> or -raw [url] |
View |
Returns realspeeds and raw speed (speed with correction time omitted) for given race.  |
None |
-lastrace [user] <race_num> or -lastrace [url] |
View |
Returns all users' realspeeds ranked by unlagged for given race.  |
lr, last |
-adjustedgraph [user] <race_num> or -adjustedgraph [url] |
View |
Returns specified race's adjusted WPM over time.  |
ag |
-matchgraph [user] <race_num> or -matchgraph [url] |
View |
Returns specified race's unlagged WPM over time for everyone in the race.  |
mg |
-leaderboard [category] <amount> |
View |
Returns a leaderboard for given category: races/points/textstyped/textbests/toptens. |
lb |
-competition <category> |
View |
Returns the daily competition for specified category: points/races/wpm; defaults to points  |
comp, c |
-lastonline [user] |
View |
Returns the last time a user played.  |
lo, ls, lastseen |
-medals [user] |
View |
Returns the medals a user has.  |
None |
-toptens [user] |
View |
Returns the number of text top 10s a user holds. 
can request JSON breakdowns with 10*. |
10, 10*, toptens* |
|
|
|
|
Advanced (all require -getdata)
Advanced commands provide detailed statistical calculations, graphs, and services aimed to help users improve their typing speed and TypeRacer statistics.
| Name |
Example |
Function |
Aliases |
-top [user] [wpm/points] |
View |
Returns user's top 10 races sorted by specified category.  |
best |
-worst [user] [wpm/points] |
View |
Returns user's worst 10 races sorted by specified cateogry.  |
bottom |
-racedetails [user] |
View |
Returns detailed breakdown of user's races.  |
rd |
-textbests [user] |
View |
Returns user's top 5 texts, worst 5 texts, and text bests average (average of best in each text).  |
tb |
-breakdown [user] |
View |
Returns detailed breakdown of text bests.  |
bd |
-personalbest [user] <text_ID> |
View |
Returns user's average, best, and worst on specified text_id. Defaults to last-raced text if none provided.  |
pb |
-unraced [user] <length> |
View |
Returns 5 randomly unraced texts under length characters.  |
ur |
-textsunder [user] [wpm] <length> |
View |
Returns 5 randomly raced texts under wpm wpm and length characters.  |
tu |
-textslessequal [user] [num] [wpm/points/times] |
View |
Returns number of texts typed more than or equal to num in specified category. |
tle, tor, to |
-racesover [user] [num] [wpm/points] |
View |
Returns number of races greater than num in specified category. |
ro |
-milestone [user] [num] [races/points/wpm] |
View |
Returns the time it took for user to achieve specified milestone. |
ms |
-marathon [user] <seconds> |
View |
Returns the most races a user completed in seconds seconds and its breakdown; defaults to 86400 (1 day).  |
42 |
-sessionstats [user] <seconds> |
View |
Returns the longest session a user completed with breaks at most seconds seconds; defaults to 1800 (30 mins.).  |
ss |
-fastestcompletion [user] [num_races] |
View |
Returns the fastest a user completed num_races races and its breakdown.  |
fc |
-boxplot [user] <user_2> ... <user_4> |
View |
Returns WPM boxplot of given user(s). Outliers are removed.  |
bp |
-histogram [user] |
View |
Returns WPM boxplot of given user.  |
hg |
-raceline <time> [user] <user_2> ... <user_10> |
View |
Returns races over time graph for given user(s); optional time parameter returns graph with only the races completed after it.  |
rl |
-improvement [user] <time/races> |
View |
Returns WPM over specified category for given user.  |
imp |
|
|
|
|
Other
Other commands provide resources, information, and links related to TypeRacer.
| Name |
Example |
Function |
Aliases |
-search [query] |
View |
Returns quotes containing given search query; each query must be at least 3 words long; query is case insensitive can request 1 word queries |
None |
-levenshtein [query] |
View |
Returns top 5 quotes with substring containing the least Levenshtein to given query; query must be at most 40 chars. can request any length |
leven |
-searchid [text_id] |
View |
Returns text matching specified text_id.  |
id |
-unixreference <timestamp> |
View |
Converts a provided UNIX timestamp to UTC time; scientific notation may be used. No parameters provided returns a conversion table. |
unix |
-serverinfo |
View |
Returns basic information about the server the bot is in. |
sinfo |
-art <artist> |
View |
Randomly returns a work of art 😺 |
None |
|
|
|
|
Maintenance
There are three things the bot must do to keep the data and itself maintained. All of these are done automatically and routinely by the bot in the background, so the bot remains 100% functional while the processes take place. These processes can be found in TypeRacerStats/TypeRacerStats/Core/Common/maintenance.py.
- Update TypeRacer users' data every 24 hours even if they have not called
-getdata that day.
- Drop the temporary tables created from
-today and -competition calls every 24 hours.
- Scrape all text pit stop pages for texts' top 10 data once a week.
Credits
Thank you to:
- the members of the TypeRacer Discord Server for command suggestions;
- http://typeracerdata.com/ for some of its APIs and database.
Invite/Permissions
The bot can be invited using this link. The default prefix is -, and it can be changed with -changeprefix [prefix].
Text Permissions
- [x] Send Messages
- [x] Embed Links
- [x] Attach Files
- [x] Read Message History
- [x] Use External Emojis
- [x] Add Reactions
Support
If you want to contribute towards hosting fees, refer to the following link.
Each month of hosting costs 6 USD, so the perks tiers are incremented by 6 each:
- Tier 1 ($0.01 - $5.99): Name listed on
info command and access to echo command
- Tier 2 ($6.00 - $11.99): Set custom embed color with
setcolor
- Tier 3 ($12.00 - $17.99): Custom command added to the bot
- Tier 4 ($18.00+): Access to commands via bot DM
Supporter commands coming soon!