{"id":18453053,"url":"https://github.com/twotau/discordspartabot","last_synced_at":"2026-05-08T09:33:38.841Z","repository":{"id":25822086,"uuid":"106644779","full_name":"TwoTau/DiscordSpartaBot","owner":"TwoTau","description":"A friendly bot for the Skyline Spartabots' Discord server","archived":false,"fork":false,"pushed_at":"2023-01-09T19:27:33.000Z","size":1403,"stargazers_count":1,"open_issues_count":11,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-24T19:51:24.508Z","etag":null,"topics":["bot","discord","nodejs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TwoTau.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-12T04:33:07.000Z","updated_at":"2021-09-21T03:42:47.000Z","dependencies_parsed_at":"2022-07-12T21:40:38.531Z","dependency_job_id":null,"html_url":"https://github.com/TwoTau/DiscordSpartaBot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TwoTau/DiscordSpartaBot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TwoTau%2FDiscordSpartaBot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TwoTau%2FDiscordSpartaBot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TwoTau%2FDiscordSpartaBot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TwoTau%2FDiscordSpartaBot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TwoTau","download_url":"https://codeload.github.com/TwoTau/DiscordSpartaBot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TwoTau%2FDiscordSpartaBot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32774943,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot","discord","nodejs"],"created_at":"2024-11-06T07:35:10.810Z","updated_at":"2026-05-08T09:33:38.824Z","avatar_url":"https://github.com/TwoTau.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Discord SpartaBot\n\n![GitHub top language](https://img.shields.io/github/languages/top/TwoTau/DiscordSpartaBot?style=flat-square)\n![GitHub last commit](https://img.shields.io/github/last-commit/TwoTau/DiscordSpartaBot?style=flat-square)\n![GitHub contributors](https://img.shields.io/github/contributors/TwoTau/DiscordSpartaBot?style=flat-square)\n![GitHub Repo stars](https://img.shields.io/github/stars/TwoTau/DiscordSpartaBot?style=flat-square)\n![GitHub license](https://img.shields.io/github/license/TwoTau/DiscordSpartaBot?style=flat-square)\n\nSpartaBot is a Discord bot made by [@TwoTau](https://github.com/twotau) using [discord.js](https://discord.js.org \"discord.js home page\"). This repository contains all the source code for the bot. If you want to fork this and run it yourself, follow the instructions in [Creating a config file](#creating-a-config-file).\n\n## (Partial) List of commands\n\nSee the [commands folder](commands/) for a full list of commands.\n\n### info `\u003coptional mentioned member\u003e`\nReturns info about the mentioned member or if no member is mentioned, the author of the message.\n\nScreenshot of `!info spartabot` (with discriminator and User ID removed):\n\n![Screenshot of !info spartabot](https://user-images.githubusercontent.com/14433542/42710963-0e51097c-869b-11e8-8269-894292cb6d0d.png)\n\n### repeat `\u003ctext\u003e`\nRepeats the message and then deletes the author's message.\n\n### when `\u003cevent name\u003e`\nWill tell you how much time there is until an event. The events are specified in `config.events`.\n\nScreenshot of `!when kickoff`:\n\n![Screenshot of !when kickoff](https://user-images.githubusercontent.com/14433542/42711718-c513de26-869d-11e8-9c40-550f90764ec6.png)\n\n### togglerole `\u003crole name\u003e`\nRemoves or adds a role from the author of the message. The role name must be in `config.toggleable_roles`;\n\n### eval `\u003cjavascript code\u003e`\nExecutes JavaScript. This command can only be used by the bot creator, specified by `config.bot_creator` and requires that `config.options.allow_eval_command` is true.\n\n### purge `\u003cnumber of messages\u003e`\nDelete the last _n_ comments. This command can only be used by admins, specified by `config.admin_role`. If `config.options.restrict_purge_to_bot_creator` is false, then this command can only be used by the bot creator.\nThe bot also sends a quote from the dystopian novels _Farenheit 451_ or _Nineteen Eighty-Four_ to discourage abuse of this command.\n\nScreenshot of `!purge 30`:\n\n![Screenshot of !purge 30](https://user-images.githubusercontent.com/14433542/31846961-eb1d036a-b5c7-11e7-98db-cbac1a0617f1.png)\n\n### log `\u003coptional name of person\u003e`\nReturns the history of the person's sign-ins and outs. This depends on the sign-in database being used (AKA `config.firebase_db_url`).\n\n- _If argument is specified_\n    - _If the author is an admin_\n        - Sends partial data in the same channel.\n        - Sends the full sign-in history in the same channel.\n    - _Else (author not an admin)_\n        - Sends partial data in the same channel.\n- _Else (no argument is specified)_\n    - Sends partial data in the same channel.\n    - Direct messages the author their full sign-in history.\n\n### tophours\nSends a list of the top nine people with the most hours.\n\nScreenshot of `!tophours` with placeholder names and hours:\n\n![Screenshot of !tophours](https://user-images.githubusercontent.com/14433542/42711996-d0bbd480-869e-11e8-9f34-5c7babf9d442.png)\n\n### subtracthours `\u003cname\u003e` `\u003ctime\u003e` `\u003coptional date\u003e`\nSubtracts specified time from the person chosen. Subtract 0:00 hours to override the previous subtraction. The time argument must be in h:mm format and be between 0:01 and 23:59. The date argument, if specified, must be in M/D format.\nSpartaBot also sends a Discord Webhook to log the subtracted hours. In this example, the webhook goes to the #logs channel.\n\nScreenshot of `!subtracthours \"Vishal Devireddy\" \"1:00\"`:\n\n![Screenshot of !subtracthours](https://user-images.githubusercontent.com/14433542/42712202-8a7ac9a8-869f-11e8-85a5-ce1d0aa39ca3.png)\n\n### tbateam `\u003cFRC team number\u003e`\nReturns information about a team using [TheBlueAlliance's API](https://www.thebluealliance.com/apidocs) given the team number.\n\nScreenshot of `!tbateam 2976`:\n\n![Screenshot of !tbateam 2976](https://user-images.githubusercontent.com/14433542/31847009-e2413b52-b5c8-11e7-9e96-357db9643aab.png)\n\n### emoji `\u003cemoji name\u003e` `\u003coptional number to repeat\u003e`\nSends an animated emoji and deletes the author's message. Only works with animated emoji. The number to repeat can be between 1 and 10.\n\n### kys\nTerminates the program. This command can only be used by the bot creator.\n\n### help `\u003coptional command\u003e`\nReturns a list of the non-hidden commands along with a description and example usage of each.\n\nScreenshot of `!help`:\n\n![Screenshot of !help](https://user-images.githubusercontent.com/14433542/42710716-0730025c-869a-11e8-940e-88a1d76c9a66.png)\n\nScreenshot of `!help tbateam`:\n\n![Screenshot of !help tbateam](https://user-images.githubusercontent.com/14433542/31846913-2e1caf40-b5c7-11e7-82c8-8e017f8a7a9f.png)\n\n## Creating a config file\n\nYou will need to create a `config.json` file in this folder with secret keys and tokens for SpartaBot. See [config-example.json](config-example.json) for a template. To find Discord user and channel IDs, [turn on Developer Mode](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-) in Discord.\n\nYou will also need a `serviceAccountKey.json` for accessing your Firebase database. You can download one from your Firebase project \u003e Settings \u003e Service accounts \u003e Firebase Admin SDK.\n\nThe keys in `config.json` are:\n- `discord_token`: The Discord bot token you find in the [Discord Developer panel](https://discordapp.com/developers/applications/me).\n- `tba_auth_key`: TheBlueAlliance API key that you find in your [TheBlueAlliance account page](https://www.thebluealliance.com/account).\n\n- `firebase_db_url`: The URL for the Firebase database that contains the sign-in data.\n- `hours_log_webhook_url`: The Discord webhook URL to send subtract hours log messages to.\n\n- `github_repo`: The ending part of the GitHub url for your fork of this repository. For example: `twotau/DiscordSpartaBot`.\n- `debug_channel_id`: The Discord channel ID for a debug channel as a string. If this is specified, SpartaBot will send some logging messages to this channel.\n- `bot_creator`: The Discord user ID for the creator of the bot. This is used for eval permission and when determining whether a user has permissions to do something.\n\n- `new_member_role`: The Discord role ID of the role SpartaBot will assign to members that join the server.\n- `other_team_role`: The Discord role ID of the role given to those of other teams. Users with this role are restricted in some ways, such as not being able to use the togglerole or log commands.\n- `admin_role`: The Discord role ID of the role given to those that can mass purge messages (if `options.restrict_purge_to_bot_creator` is false) and have access to members' full hour logs.\n\n- `options`: An object containing the following properties:\n\t- `prefix`: The characters that a message needs to start with for SpartaBot to recognize the message as a command. Common prefixes are `!` and `?`.\n\t- `allow_eval_command`: A boolean for whether SpartaBot can respond to the eval command if sent by the bot's owner. This is very dangerous because it allows the bot's owner to execute any code.\n\t- `enable_log_command`: A boolean for whether users can use the log command (should only be true for the build season).\n\t- `restrict_purge_to_bot_creator`: A boolean for whether only the bot creator can use the purge command. If false, anyone with the `admin_role` can use purge.\n\n- `automated_message`: An object containing values relevant to automated messages:\n\t- `open_door_message`: The message to send when someone asks for the build room door to be opened.\n\n- `toggleable_roles`: An object containing the name of the toggleable roles as the keys and the Discord role IDs (in string format) as the values.\n\n- `events`: An object containing the short name of the events as the keys and objects (with the event name and ISO timestamp) as the values. For example:\n\t- _short argument name_: An argument for the when command.\n\t\t- `name`: The full name of the event.\n\t\t- `timestamp` the ISO date time. For example: \"2018-02-20T20:59:00.000\".\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwotau%2Fdiscordspartabot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftwotau%2Fdiscordspartabot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwotau%2Fdiscordspartabot/lists"}