bot.exts.fun.typeracer#

Typeracer game.

Module Contents#

Classes#

Race

Class to manage each typerace.

Typeracer

Play typeracer.

Functions#

setup(→ None)

Load the Typeracer cog.

class bot.exts.fun.typeracer.Race(ctx: discord.ext.commands.Context, number_of_words: int)[source]#

Class to manage each typerace.

_next_word() None[source]#

Get the next word.

_word_display() str[source]#

Return word to display with Zero Width Space inserted to prevent copy pasting.

_update_scoreboard(user_id: int, username: str) None[source]#

Update the scoreboard.

game_over() bool[source]#

Check if the game is over.

word_embed() discord.Embed[source]#

Build the word embed.

is_correct(answer: str) bool[source]#

Check if the answer is correct.

is_copypaste(answer: str) bool[source]#

Check if answer is copypasted.

check_message(message: discord.Message) bool[source]#

Check function for processing valid inputs.

scoreboard_embed() discord.Embed[source]#

Build the scoreboard embed.

process_correct_answer(message: discord.Message) discord.Embed[source]#

Process if the answer is correct.

class bot.exts.fun.typeracer.Typeracer(bot: bot.bot.Bot)[source]#

Bases: discord.ext.commands.Cog

Play typeracer.

async typeracer(ctx: discord.ext.commands.Context, number_of_words: int = 5) None[source]#

Play Typeracer.

Number of words defaults to 5 if not specified. Max number of words is 30.

async bot.exts.fun.typeracer.setup(bot: bot.bot.Bot) None[source]#

Load the Typeracer cog.