Skip to content

Tutorial

Robin CHARPENTIER edited this page Sep 11, 2021 · 24 revisions

Hi, this is a tutorial on how to invite and setup the Tosurnament bot.

Just a little explanation of the nomenclature used below:

  • <parameter> means that the parameter is mandatory. It does not mean you have to write <parameter> or parameter.
  • [<parameter>] means that the parameter is optional. It does not mean you have to write [<parameter>], <parameter> or parameter.

Here we go!

Step 1: Invite the bot on your server

  1. You just need to click here.
  2. Select the server on which you want the bot to be.
  3. Click Authorize.

Step 1.1: Change the bot language if needed

By default, the bot is in English. You can see the list of language available by using the ;set_language command.
If you find a language to use, you can then use ;set_language <language> with <language> being the chosen language. For example: ;set_language fr.
If you do not find a language to use, you can contribute to this repository. Please check the README for more information.

Step 2: Create the tournament

On your server, use this command: ;create_tournament <acronym> <name> [<bracket_name>].
NOTE: [<bracket_name>] is optional, use it if you have multiple brackets.

Examples:

  • ;create_tournament RT "Random Tournament"
  • ;create_tournament RT "Random Tournament" "Tier 1"

IMPORTANT: the " are mandatory for tournament name containing spaces.

In case you did a mistake, you can use the following commands:

  • ;set_tournament_name <name>
  • ;set_tournament_acronym <acronym>
  • ;set_bracket_name <bracket_name>

Your tournament is now created!

Now you should use set an admin role on the bot to allow other people to modify the bot settings: ;set_admin_role <role>.

Examples:

  • ;set_admin_role Admin (just the name of the role)
  • ;set_admin_role @Admin

Step 3: Tournament global settings

It is now time to set up some global settings, used whether you have one or multiple brackets.

Step 3.1: Role settings

Player role

It will allow those with the role to use specific commands, like reschedule.

Command: ;set_player_role <role>, where <role> is a role (or role name) on your server.

Example: ;set_player_role Player (or ;set_player_role @Player works too)


Referee role

It will allow referees to take/drop matches present on the schedules spreadsheet.

Command: ;set_referee_role <role>


Streamer role

It will allow streamers to take/drop matches present on the schedules spreadsheet.

Command: ;set_streamer_role <role>


Commentator role

It will allow commentators to take/drop matches present on the schedules spreadsheet.

Command: ;set_commentator_role <role>


Team captain role

If you are hosting a team tournament, you might be interested in the team captain role. It will be used for reschedule (only the team captain can make/accept/deny reschedules).

Command: ;set_team_captain_role <role>


Step 3.2: Channel settings

Staff channel

It will be used for reschedule alerts and referee match notification alerts.

Command: ;set_staff_channel <channel>

Example: ;set_staff_channel #staff_channel


Match notification channel

It will be used for player match notification alerts.

Command: ;set_match_notification_channel <channel>


Step 3.3: Miscellaneous settings

Reschedule deadline before current match time in hours

It will be used during reschedule, checking that the previous time of the match are in more than X hours, X being the number of hours set. By default, it is set to 6.

Command: ;set_reschedule_deadline_hours_before_current_time <hours>

Example: ;set_reschedule_deadline_hours_before_current_time 12


Reschedule deadline before new match time in hours

It will be used during reschedule, checking that the new time of the match are in more than X hours, X being the number of hours set. By default, it is set to 24.

Command: ;set_reschedule_deadline_hours_before_new_time <hours>

Example: ;set_reschedule_deadline_hours_before_new_time 12


Reschedule deadline maximum date

It will be used during reschedule, checking that the new time is before the specified date. The date format is <day_of_the_week> <time: HH:mm> where <day_of_the_week> is the day of the week in English in all letters (ex: Monday). The date is either in UTC by default, or uses the timezone defined with ;set_utc.

Command: ;set_reschedule_deadline_end <day_of_the_week> <time: HH:mm>

Example: ;set_reschedule_deadline_end Monday 12:00


Ping team

If you are hosting a team tournament, there is a ping team setting. It will ping a team when set to True, or the team captain when set to False (if the Team Captain role is not set, it will take the 1st player of the team). By default, it is set to True.

Command: ;set_ping_team <boolean>

Example: ;set_ping_team false


Timezone

If you are hosting a timezone-specific tournament, you can specify the timezone the bot will use when displaying and processing dates. The format to use is +HH:mm or -HH:mm. By default, it is set to +00:00.

Command: ;set_utc <tz_info>

Example: ;set_utc +02:00


Date format

If you want to use plain text date/time in your spreadsheets, you need to set this setting. This command uses specific flags that you can find here. By default, it is set to %d %B.

Command: ;set_date_format <date_format>

Example: ;set_date_format %d/%m/%Y


Step 4: Bracket specific settings

Step 4.0: For multiple brackets tournament

Create bracket

You will need to create other brackets first.

Command: ;create_bracket <name>

Example: ;create_bracket Tier 2


Get bracket (to change its settings)

Now, remember that you will need to set the settings for each bracket individually (a dashboard to ease this process will come later on). To change the current bracket on which you will change the settings, you need to use: ;get_bracket <index>. The <index> of each bracket is given to you when using ;get_bracket without any parameter.

Example: ;get_bracket 2


Change bracket name

You can also change the name of a bracket.

Command: ;set_bracket_name <name>

Example: ;set_bracket_name Tier 3


Step 4.1: Initial spreadsheet setup

Before setting the spreadsheets, you need to authorize the bot to read and write in your spreadsheet. You have 2 choices, either:

  • Create an Edit shareable link: click on SHARE -> Get a shareable link -> Anyone with the link can edit.
  • Share the spreadsheet to the TosurnamentBot account: click on SHARE -> In the box below People, write tosurnament-bot@tosurnament-bot.iam.gserviceaccount.com (don't worry if you receive a mail saying it didn't find the recipient).

Step 4.1.1: Important information about spreadsheets and ranges

The <range> parameter present below is a google spreadsheet range. For more info, please check the A1 notation here.

All the ranges to set below MUST BE REAL DATA AND NOT FORMULAS. If you have information in different sheets (tabs) for the same spreadsheet, you can prefix a range like this: Sheet Name!A2:A.

If you need to have separated ranges for the same range setting, you can do it like this: A2:A,C2:C,E2:E,G2:G.

After setting up the spreadsheets, if you do manual updates to any of them, please remember to use ;sync_spreadsheet. It shouldn't be needed most of the time, but it is better to always do it.

Step 4.2: Schedules spreadsheet settings

Schedules spreadsheet

Command: ;set_schedules_spreadsheet <spreadsheet_id> <sheet_name>, where <spreadsheet_id> is the url or the id of the spreadsheet and <sheet_name> is the name of the sheet (tab) containing the schedules. If no <sheet_name> is given as parameter, it will use the first sheet (tab) present in the spreadsheet.

Example: ;set_schedules_spreadsheet https://docs.google.com/spreadsheets/d/1A0zgYzD8gGHkyISuaqTDxIhoiJ_3lDyTkF_M0IJ4K14 Tier 1


Sheet (tab) name

You can also change the sheet used.

Command: ;set_schedules_spreadsheet_sheet_name <sheet_name>

Example: ;set_schedules_spreadsheet_sheet_name Tier 2


Range match id (mandatory)

It will be used for reschedule and taking/dropping matches. Even if there are different brackets, every match id must be unique.

Command: ;set_schedules_spreadsheet_range_match_id <range>

Example: ;set_schedules_spreadsheet_range_match_id A2:A


Range team1 (mandatory)

It should be a column containing the first team/player of the schedule.

Command: ;set_schedules_spreadsheet_range_team1 <range>


Range team2 (mandatory)

It should be a column containing the second team/player of the schedule.

Command: ;set_schedules_spreadsheet_range_team2 <range>


Range date (mandatory)

It will be used to get/change the match date.

Command: ;set_schedules_spreadsheet_range_date <range>


Range time (mandatory, unless you use date range as date+time range)

It will be used to get/change the match time.

Command: ;set_schedules_spreadsheet_range_time [<range>]


Range referee (mandatory)

It will be used to take/drop matches and be notified by alerts.

Command: ;set_schedules_spreadsheet_range_referee <range>


Range streamer

It will be used to take/drop matches.

Command: ;set_schedules_spreadsheet_range_streamer [<range>]


Range commentator

It will be used to take/drop matches.

Command: ;set_schedules_spreadsheet_range_commentator [<range>]


Range score team1

It will be filled with the score of team1 when using the post_result command.

Command: ;set_schedules_spreadsheet_range_score_team1 [<range>]


Range score team2

It will be filled with the score of team2 when using the post_result command.

Command: ;set_schedules_spreadsheet_range_score_team2 [<range>]


Range mp links

It will be filled with the mp links of the match when using the post_result command.

Command: ;set_schedules_spreadsheet_range_mp_links [<range>].


Date format (deprecated)

This command has been changed to ;set_date_format. Also, the bot can now read date and time without needing to change the format to Plain Text.

It will be used to read/write the right format in the match schedule. This command uses specific flags that you can find here. By default, it is set to %d %B.

Command: ;set_schedules_spreadsheet_date_format <date_format>

Example: ;set_schedules_spreadsheet_date_format %d/%m/%Y


Staff is a range

If set to False, one cell can contain multiple staffs and there cannot be multiple cells for the same row. For example, a match will have a commentator cell that can have 2 commentators like: Commentator A / Commentator B. If set to True, one cell can only contain 1 staff but there can be multiple cells for the same row. For example, a match will have 2 commentator cells like: Commentator A | Commentator B. By default, it is set to False.

Command: ;set_schedules_spreadsheet_staff_is_range <boolean>

Example: ;set_schedules_spreadsheet_staff_is_range True


Step 4.3: Players spreadsheet settings

Players spreadsheet

Command: ;set_players_spreadsheet <spreadsheet_id> <sheet_name>, where <spreadsheet_id> is the url or the id of the spreadsheet and <sheet_name> is the name of the sheet (tab) containing the players list. If no <sheet_name> is given as parameter, it will use the first sheet (tab) present in the spreadsheet.

Example: ;set_players_spreadsheet https://docs.google.com/spreadsheets/d/1A0zgYzD8gGHkyISuaqTDxIhoiJ_3lDyTkF_M0IJ4K14 Players


Sheet (tab) name

If you need to change the sheet used.

Command: ;set_players_spreadsheet_sheet_name <sheet_name>

Example: ;set_players_spreadsheet_sheet_name Player list


Range team name (mandatory, in team brackets only)

It will be used for every player command. Do not set it for single player tournament.

Command: ;set_players_spreadsheet_range_team_name [<range>]


Range team (mandatory)

It needs to contain all players name. It will be used for every player command.

Command: ;set_players_spreadsheet_range_team <range>


Range discord (use range discord id instead if possible)

If you want to not make the player use the link command, you will need to set the discord or discord id range, as it will be used to identify/ping the players.

Command: ;set_players_spreadsheet_range_discord [<range>]


Range discord id

If you want to not make the player use the link command, you will need to set the discord or discord id range, as it will be used to identify/ping the players.

Command: ;set_players_spreadsheet_range_discord_id [<range>]


Step 4.4: Miscellaneous settings

Bracket role

It can be used by some commands. Useful in multiple brackets tournament.

Command: ;set_bracket_role <role>


Challonge

It will be filled automatically if using the post_result command.

Command: ;set_challonge <tournament_id>, where <tournament_id> can be either the tournament url or id.

Example: ;set_challonge https://challonge.com/testandroid/


Step 5: Testing and advanced settings

After setting everything, you might want to test if everything works correctly. Please refer to this page if you want to test your settings.

For more advanced settings, please refer to the pages below:

Clone this wiki locally