This commit is contained in:
Sakimori 2021-01-04 15:24:44 -05:00
commit 5870325254
2 changed files with 34 additions and 34 deletions

View File

@ -15,35 +15,35 @@ accepting pull requests, check the issues for to-dos.
#### creation and deletion: #### creation and deletion:
- m;saveteam - m;saveteam
- saves a team to the database allowing it to be used for games. use this command at the top of a list with each of these in a new line after: - saves a team to the database allowing it to be used for games. use this command at the top of a list with entries separated by new lines:
- the team's name. - the first line of the list is your team's name.
- the team's icon and slogan, generally this is an emoji followed by a space, followed by a short slogan. - the second line is the team's icon and slogan, generally this is an emoji followed by a space, followed by a short slogan.
- a blank line. - the third line must be blank.
- the batters' names in the order you want them to appear in your lineup, each on its own line. lineups can contain any number of batters between 1 and 12. - the next lines are your batters' names in the order you want them to appear in your lineup, lineups can contain any number of batters between 1 and 12.
- a blank line. - then another blank line seperating your batters and your pitchers.
- the pitchers' names in the order you want them to appear in your rotation. rotations can contain any number of pitchers between 1 and 8. - the final lines are the names of the pitchers in your rotation, rotations can contain any number of pitchers between 1 and 8.
- if you did everything correctly you'll get a team embed with a prompt to confirm. hit the 👍 and your team will be saved! - if you did it correctly, you'll get a team embed with a prompt to confirm. hit the 👍 and your team will be saved!
- m;deleteteam [teamname] (requires team ownership) - m;deleteteam [teamname] (requires team ownership)
- allows you to delete the team with the provided name. you'll get an embed with a confirmation to prevent accidental deletions. hit the 👍 and your team will be deleted. - allows you to delete the team with the provided name. you'll get an embed with a confirmation to prevent accidental deletions. hit the 👍 and your team will be deleted.
- m;import - m;import
- imports an onomancer collection as a new team. you can use the new onomancer simsim setting to ensure compatibility. similarly to saveteam, you'll get a team embed with a prompt to confirm, hit the 👍 and your team will be saved! - imports an onomancer collection as a new team. you can use the new onomancer simsim setting to ensure compatibility. similarly to saveteam, you'll get a team embed with a prompt to confirm, hit the 👍 and your team will be saved!
#### editing (all of these commands require ownership of the team used): #### editing (all of these commands require ownership and exact spelling of the team name):
- m;addplayer batter/pitcher [team name] [player name] - m;addplayer batter/pitcher [team name] [player name]
- adds a new player to the end of your team, either in the lineup or the rotation depending on which version you use. use addplayer batter or addplayer pitcher at the top of a list with each of these in a new line after: - adds a new player to the end of your team, either in the lineup or the rotation depending on which version you use. use addplayer batter or addplayer pitcher at the top of a list with entries separated by new lines:
-the name of the team you want to add the player to. - the name of the team you want to add the player to.
-the name of the player you want to add to the team. - the name of the player you want to add to the team.
- m;moveplayer [team name] [player name] [new lineup/rotation position number] - m;moveplayer [team name] [player name] [new lineup/rotation position number]
- changes the position of a player within your lineup or rotation. if you want to instead move a player from your rotation to your lineup or vice versa, use m;swapsection instead. use this command at the top of a list with each of these in a new line after: - moves a player within your lineup or rotation. if you want to instead move a player from your rotation to your lineup or vice versa, use m;swapsection instead. use this command at the top of a list with entries separated by new lines:
- the name of the team you want to move the player on. - the name of the team you want to move the player on.
- the name of the player you want to move. - the name of the player you want to move.
- the position you want to move them too, indexed with 1 being the first position of the lineup or rotation. all players below the specified position in the lineup or rotation will be pushed down. - the position you want to move them too, indexed with 1 being the first position of the lineup or rotation. all players below the specified position in the lineup or rotation will be pushed down.
- m;swapsection [team name] [player name] - m;swapsection [team name] [player name]
- swaps a player from your lineup to the end of your rotation or your rotation to the end of your lineup. use this command at the top of a list followed by each of these in a new line after: - swaps a player from your lineup to the end of your rotation or your rotation to the end of your lineup. use this command at the top of a list with entries separated by new lines:
- the name of the team you want to swap the player on. - the name of the team you want to swap the player on.
- the name of the player you want to swap. - the name of the player you want to swap.
- m;removeplayer [team name] [player name] - m;removeplayer [team name] [player name]
- removes a player from your lineup or rotation. if there are multiple copies of the same player on a team this will only delete the first one. use this command at the top of a list with each of these in a new line after: - removes a player from your team. if there are multiple copies of the same player on a team this will only delete the first one. use this command at the top of a list with entries separated by new lines:
- the name of the team you want to remove the player from. - the name of the team you want to remove the player from.
- the name of the player you want to remove. - the name of the player you want to remove.
@ -61,13 +61,13 @@ accepting pull requests, check the issues for to-dos.
- m;idolize [name] - m;idolize [name]
- records any name as your idol, mostly for fun. - records any name as your idol, mostly for fun.
- m;showidol - m;showidol
- displays your idol's name and stars. - displays your idol's name and stars in a discord embed.
### game commands: ### game commands:
- m;startgame --day # or -d # - m;startgame --day # or -d #
- starts a game with premade teams made using saveteam. provides a link to the website where you can watch the game. - starts a game with premade teams made using saveteam. provides a link to the website where you can watch the game.
- the --day/-d is optional, if used it'll force the game to use the #th spot in each team's rotations. if this number is larger than the number of pitchers in one or both of the teams' rotations it'll wrap around. if it is not used pitchers will be chosen randomly from the teams' rotations. - the --day/-d is optional, if used it'll force the game to use the #th spot in each team's rotations. if this number is larger than the number of pitchers in one or both of the teams' rotations it'll wrap around. if it is not used pitchers will be chosen randomly from the teams' rotations.
- use this command at the top of a list with each of these in a new line after: - use this command at the top of a list with entries separated by new lines:
- the away team's name. - the away team's name.
- the home team's name. - the home team's name.
- optionally, the number of innings, which must be greater than 2 and less than 31. if not included it will default to 9. - optionally, the number of innings, which must be greater than 2 and less than 31. if not included it will default to 9.
@ -75,9 +75,9 @@ accepting pull requests, check the issues for to-dos.
- m;randomgame - m;randomgame
- starts a 9-inning game between 2 entirely random teams. embrace chaos! - starts a 9-inning game between 2 entirely random teams. embrace chaos!
- m;starttournament --rounddelay # - m;starttournament --rounddelay #
- starts a randomly seeded tournament with up to 64 provided teams, automatically adding byes as nescesary. all rounds are best of 5 until the finals which is best of 7. all series have a 5 minute break between games. - starts a randomly seeded tournament with up to 64 provided teams, automatically adding byes as necessary. all series have a 5 minute break between games. the current format is: best of 5 until the finals which are best of 7.
- the --rounddelay is optional, if used, # must be between 1 and 120 and it'll set the delay between rounds to be # minutes. if not included it will default to 10. - the --rounddelay is optional, if used, # must be between 1 and 120 and it'll set the delay between rounds to be # minutes. if not included it will default to 10.
- use this command at the top of a list with each of these in a new line after: - use this command at the top of a list with entries separated by new lines:
- the name of the tournament. - the name of the tournament.
- the name of each participating team on its own line. - the name of each participating team on its own line.

View File

@ -99,7 +99,7 @@ class ShowIdolCommand(Command):
class ShowPlayerCommand(Command): class ShowPlayerCommand(Command):
name = "showplayer" name = "showplayer"
template = "m;showplayer [name]" template = "m;showplayer [name]"
description = "Displays any name's stars in a nice discord embed, there's a limit of 70 characters. That should be *plenty*. Note: if you want to lookup a lot of different players you can do it on onomancer instead of spamming this command a bunch and clogging up discord: https://onomancer.sibr.dev/reflect" description = "Displays any name's stars in a nice discord embed, there's a limit of 70 characters. That should be *plenty*. Note: if you want to lookup a lot of different players you can do it on onomancer here instead of spamming this command a bunch and clogging up discord: <https://onomancer.sibr.dev/reflect>"
async def execute(self, msg, command): async def execute(self, msg, command):
player_name = json.loads(ono.get_stats(command.split(" ",1)[1])) player_name = json.loads(ono.get_stats(command.split(" ",1)[1]))
@ -108,7 +108,7 @@ class ShowPlayerCommand(Command):
class StartGameCommand(Command): class StartGameCommand(Command):
name = "startgame" name = "startgame"
template = "m;startgame [away] [home] [innings]" template = "m;startgame [away] [home] [innings]"
description ="""Starts a game with premade teams made using saveteam, use this command at the top of a list followed by each of these in a new line (shift+enter in discord, or copy+paste from notepad): description ="""Starts a game with premade teams made using saveteam, use this command at the top of a list followed by each of these in a new line (shift+enter in discord, or copy+paste from notepad) (this command has fuzzy search so you don't need to type the full name of the team as long as you give enough to identify the team you're looking for.):
- the away team's name. - the away team's name.
- the home team's name. - the home team's name.
- and finally, optionally, the number of innings, which must be greater than 2 and less than 31. if not included it will default to 9.""" - and finally, optionally, the number of innings, which must be greater than 2 and less than 31. if not included it will default to 9."""
@ -181,7 +181,7 @@ class StartGameCommand(Command):
class StartRandomGameCommand(Command): class StartRandomGameCommand(Command):
name = "randomgame" name = "randomgame"
template = "m;randomgame" template = "m;randomgame"
description = "Starts a 9-inning game between 2 entirely random teams. Embrace chaos." description = "Starts a 9-inning game between 2 entirely random teams. Embrace chaos!"
async def execute(self, msg, command): async def execute(self, msg, command):
if config()["game_freeze"]: if config()["game_freeze"]:
@ -231,13 +231,13 @@ class SaveTeamCommand(Command):
[rotation]""" [rotation]"""
description = """Saves a team to the database allowing it to be used for games. Send this command at the top of a list, with entries separated by new lines (shift+enter in discord, or copy+paste from notepad). description = """Saves a team to the database allowing it to be used for games. Send this command at the top of a list, with entries separated by new lines (shift+enter in discord, or copy+paste from notepad).
- the first line of the list is your team's name (cannot contain emoji). - the first line of the list is your team's name.
- the second line is your team's icon and slogan, this should begin with an emoji followed by a space, followed by a short slogan. - the second line is the team's icon and slogan, generally this is an emoji followed by a space, followed by a short slogan.
- the third line must be blank. - the third line must be blank.
- the next lines are your batters' names in the order you want them to appear in your lineup, lineups can contain any number of batters between 1 and 12. - the next lines are your batters' names in the order you want them to appear in your lineup, lineups can contain any number of batters between 1 and 12.
- there must be another blank line between your batters and your pitchers. - there must be another blank line between your batters and your pitchers.
- the final lines are your pitchers' names. - the final lines are the names of the pitchers in your rotation, rotations can contain any number of pitchers between 1 and 8.
if you did it correctly, you'll get a team embed with a prompt to confirm. hit the 👍 and it'll be saved.""" If you did it correctly, you'll get a team embed with a prompt to confirm. hit the 👍 and your team will be saved!"""
async def execute(self, msg, command): async def execute(self, msg, command):
if db.get_team(command.split('\n',1)[1].split("\n")[0]) == None: if db.get_team(command.split('\n',1)[1].split("\n")[0]) == None:
@ -252,7 +252,7 @@ if you did it correctly, you'll get a team embed with a prompt to confirm. hit t
class ImportCommand(Command): class ImportCommand(Command):
name = "import" name = "import"
template = "m;import [onomancer collection URL]" template = "m;import [onomancer collection URL]"
description = "Imports an onomancer collection as a new team. You can use the new onomancer simsim setting to ensure compatibility." description = "Imports an onomancer collection as a new team. You can use the new onomancer simsim setting to ensure compatibility. Similarly to saveteam, you'll get a team embed with a prompt to confirm, hit the 👍 and your team will be saved!"
async def execute(self, msg, command): async def execute(self, msg, command):
team_raw = ono.get_collection(command.strip()) team_raw = ono.get_collection(command.strip())
@ -269,7 +269,7 @@ class ImportCommand(Command):
class ShowTeamCommand(Command): class ShowTeamCommand(Command):
name = "showteam" name = "showteam"
template = "m;showteam [name]" template = "m;showteam [name]"
description = "Shows information about any saved team." description = "Shows the lineup, rotation, and slogan of any saved team in a discord embed with primary stat star ratings for all of the players. This command has fuzzy search so you don't need to type the full name of the team as long as you give enough to identify the team you're looking for."
async def execute(self, msg, command): async def execute(self, msg, command):
team_name = command.strip() team_name = command.strip()
@ -314,7 +314,7 @@ class SwapPlayerCommand(Command):
template = """m;swapsection template = """m;swapsection
[team name] [team name]
[player name]""" [player name]"""
description = "Swaps a player from lineup to rotation, or from rotation to lineup. Requires team ownership and exact spelling of team name." description = "Swaps a player from your lineup to the end of your rotation or your rotation to the end of your lineup. Requires team ownership and exact spelling of team name."
async def execute(self, msg, command): async def execute(self, msg, command):
try: try:
@ -343,7 +343,7 @@ class MovePlayerCommand(Command):
[team name] [team name]
[player name] [player name]
[new lineup/rotation position number] (indexed with 1 being the top)""" [new lineup/rotation position number] (indexed with 1 being the top)"""
description = "Moves a player in your lineup or rotation. Requires team ownership and exact spelling of team name." description = "Moves a player within your lineup or rotation. If you want to instead move a player from your rotation to your lineup or vice versa, use m;swapsection instead. Requires team ownership and exact spelling of team name."
async def execute(self, msg, command): async def execute(self, msg, command):
try: try:
@ -373,7 +373,7 @@ class AddPlayerCommand(Command):
template = """m;addplayer pitcher (or m;addplayer batter) template = """m;addplayer pitcher (or m;addplayer batter)
[team name] [team name]
[player name]""" [player name]"""
description = "Recruits a new player to your team, as either a pitcher or a batter. Requires team ownership and exact spelling of team name." description = "Adds a new player to the end of your team, either in the lineup or the rotation depending on which version you use. Requires team ownership and exact spelling of team name."
async def execute(self, msg, command): async def execute(self, msg, command):
try: try:
@ -406,7 +406,7 @@ class RemovePlayerCommand(Command):
template = """m;removeplayer template = """m;removeplayer
[team name] [team name]
[player name]""" [player name]"""
description = "Removes a player from your team. Requires team ownership and exact spelling of team name." description = "Removes a player from your team. If there are multiple copies of the same player on a team this will only delete the first one. Requires team ownership and exact spelling of team name."
async def execute(self, msg, command): async def execute(self, msg, command):
try: try:
@ -452,7 +452,7 @@ class HelpCommand(Command):
class DeleteTeamCommand(Command): class DeleteTeamCommand(Command):
name = "deleteteam" name = "deleteteam"
template = "m;deleteteam [name]" template = "m;deleteteam [name]"
description = "Allows you to delete the team with the provided name. Requires team ownership. If you are the owner and the bot is telling you it's not yours, contact xvi and xie can assist." description = "Allows you to delete the team with the provided name. You'll get an embed with a confirmation to prevent accidental deletions. Hit the 👍 and your team will be deleted.. Requires team ownership. If you are the owner and the bot is telling you it's not yours, contact xvi and xie can assist."
async def execute(self, msg, command): async def execute(self, msg, command):
team_name = command.strip() team_name = command.strip()
@ -486,7 +486,7 @@ class StartTournamentCommand(Command):
template = """m;starttournament template = """m;starttournament
[tournament name] [tournament name]
[list of teams, each on a new line]""" [list of teams, each on a new line]"""
description = "Starts a tournament with the teams given. Byes will be given to teams to allow for numbers other than powers of two. The current tournament format is:\nBest of 5 until the finals, which are Best of 7" description = "Starts a randomly seeded tournament with up to 64 provided teams, automatically adding byes as necessary. All series have a 5 minute break between games and by default there is a 10 minute break between rounds. The current tournament format is:\nBest of 5 until the finals, which are Best of 7."
async def execute(self, msg, command): async def execute(self, msg, command):
if config()["game_freeze"]: if config()["game_freeze"]: