{"id":19199134,"url":"https://github.com/osu-cascades/hackbot","last_synced_at":"2025-05-09T01:22:00.812Z","repository":{"id":14138162,"uuid":"75887604","full_name":"osu-cascades/hackbot","owner":"osu-cascades","description":"Discord bot for the Cascades Tech Club Discord server","archived":false,"fork":false,"pushed_at":"2025-03-26T10:28:16.000Z","size":2618,"stargazers_count":4,"open_issues_count":71,"forks_count":9,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-26T11:35:06.063Z","etag":null,"topics":["bot","discord-bot","discord-js","javascript","nodejs"],"latest_commit_sha":null,"homepage":"https://discordapp.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/osu-cascades.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-08T00:30:08.000Z","updated_at":"2020-10-22T06:43:36.000Z","dependencies_parsed_at":"2023-12-20T11:12:47.691Z","dependency_job_id":"13457ab9-d5f4-45cc-a46c-e94d1ca3203c","html_url":"https://github.com/osu-cascades/hackbot","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osu-cascades%2Fhackbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osu-cascades%2Fhackbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osu-cascades%2Fhackbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osu-cascades%2Fhackbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/osu-cascades","download_url":"https://codeload.github.com/osu-cascades/hackbot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253172142,"owners_count":21865470,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-bot","discord-js","javascript","nodejs"],"created_at":"2024-11-09T12:25:44.708Z","updated_at":"2025-05-09T01:22:00.577Z","avatar_url":"https://github.com/osu-cascades.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hackbot\n\n|What|Badge|\n|---|---|\n|Master Build|[![Build Status](https://travis-ci.org/osu-cascades/hackbot.svg?branch=master)](https://travis-ci.org/osu-cascades/hackbot)|\n|Staging Build|[![Build Status](https://travis-ci.org/osu-cascades/hackbot.svg?branch=dev)](https://travis-ci.org/osu-cascades/hackbot)|\n|Maintainability|[![Maintainability](https://api.codeclimate.com/v1/badges/96320fe592c30381915f/maintainability)](https://codeclimate.com/github/osu-cascades/hackbot)|\n|Test Coverage|[![Test Coverage](https://api.codeclimate.com/v1/badges/96320fe592c30381915f/test_coverage)](https://codeclimate.com/github/osu-cascades/hackbot)|\n|Snyk|[![Known Vulnerabilities](https://snyk.io/test/github/osu-cascades/hackbot/badge.svg?targetFile=package.json)](https://snyk.io/test/github/osu-cascades/hackbot?targetFile=package.json)|\n\n\n\nA Discord bot for the Cascades Tech Club [Discord](http://discordapp.com) server. To add a command, see the [Commands](#commands) section below.\n\n## Setup\n\nTo work on _hackbot_, you should:\n\n1. Clone this repository: `git clone https://github.com/osu-cascades/hackbot.git`\n2. Install the latest [node.js](https://nodejs.org).\n3. Install the dependencies: `cd hackbot \u0026\u0026 npm install`\n4. Log in to Discord, visit the Developer resources interface, and navigate to [the _My Apps_ screen](https://discordapp.com/developers/applications/me).\n5. Add a new app and give it a name, eg. _hackbot-myname-dev_.\n6. Click the _Create a Bot User_ button.\n7. Notice the Client ID, reveal your app's Token, and record them both for later.\n8. Visit [https://discordapp.com/oauth2/authorize?client_id=INSERT_CLIENT_ID_HERE\u0026scope=bot\u0026permissions=0](https://discordapp.com/oauth2/authorize?client_id=INSERT_CLIENT_ID_HERE\u0026scope=bot\u0026permissions=0), replacing the placeholder with your real Client ID.\n9. Select the server that you want the bot to join.\n10. Copy the hidden **.env-example** file to **.env**, and replace the placeholder values with your own.[1]\n11. Run the bot from the command line: `npm start`\n12. Hack...\n\n[1] _The !search command requires a Google API key from the [Google API Console](https://console.developers.google.com) and the !weather command requires an API key from [OpenWeather.org](https://openweathermap.org/)_\n\n## Suggested Workflow\n\nIn a nutshell, work in the [dev](https://github.com/osu-cascades/hackbot/tree/dev) branch and don't merge to [master](https://github.com/osu-cascades/hackbot/tree/master) unless:\n\n1. You've communicated your changes to others and given folks a _little_ time to respond (or ideally, do a code review).\n2. Your changes are innocuous.\n\nIn all cases, be sure to run the test suite to make sure all tests pass. _All tests should be passing before you merge dev to master_.\n\nYou should embrace testing. _hackbot_ uses the [Jest](https://facebook.github.io/jest/) test framework. Have two console panes open: one for running and watching the test suite, and the other for everything else you need to do. You can run the test suite once with `npm test`. Once you get tired of running `npm test` manually, use the watcher by running `npm run test:watch`. It is sweet and people will think you are a super hacker. Look at `__tests__/commands/add.test.ts` for an example of how to test commands and their channel messages. If you use VSCode for your IDE there's a Jest extension that will run a watcher and give you inline updates on your tests, as well as a few other awesome features!\n\nPlease refer to [airbnb's style guide](https://github.com/airbnb/javascript) while coding.\n\nFor now try to keep the linter happy. You can see any lint issues by running `npm run lint`. Some issues can be auto-fixed with `npm run lint:fix`\n\n## Commands\n\nTo enable hackbot to respond to a new command, all you need to do is:\n\n1. Copy the existing *src/commands/_template.js* to a new, well-named js file in the _commands_ directory: `cp src/commands/_template.ts src/commands/foo.ts`.\n2. In your new js file, replace occurrences of `CommandName` with your actual command name. Ensure that this js file contains a class definition that extends `Command` and implements the static `description` and `execute` methods. See _add.js_ or _say.js_ for some simple examples.\n\n## Deploying\n\nHackbot is hosted on [Heroku](https://heroku.com) as two _worker_-based applications:\n\n* osu-hackbot\n* osu-hackbot-staging\n\nOnce you're happy with your new _hackbot_ feature running on your development environment, deploy it to staging so that the bot stays running and other people\ncan try it out. This bot is always named _hackbot-staging_. Once you're happy, you can deploy it to production; this bot is always named _hackbot_.\n\n1. Get a [Heroku](https://heroku.com) account.\n2. Install the [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli).\n3. Become a collaborator on the staging and production apps (ask others how).\n4. Add the remotes for staging and production: `heroku git:remote -a osu-hackbot -r production \u0026\u0026 heroku git:remote -a osu-hackbot-staging -r staging`\n5. Deploy to staging: `git push staging` or `git push staging dev:master` or `git push staging feature-branch-name:master`.\n6. Deploy to production: `git push production`.\n\n## References\n\n* [Creating a Discord bot and getting a token](https://github.com/reactiflux/discord-irc/wiki/Creating-a-discord-bot-\u0026-getting-a-token)\n* [Tutorial: Creating a Simple Discord Bot](https://medium.com/@renesansz/tutorial-creating-a-simple-discord-bot-9465a2764dc0)\n* [Video Series: Creating a Discord bot with Discord.js!](https://youtu.be/rVfjZrqoQ7o)\n* [Deploying a Bot on Heroku](http://shiffman.net/a2z/bot-heroku/)\n* [discord.js Documentation](https://discord.js.org)\n\n___\n©2018 All rights reserved.\n\nThanks to our [contributors](https://github.com/osu-cascades/hackbot/graphs/contributors)!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosu-cascades%2Fhackbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fosu-cascades%2Fhackbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosu-cascades%2Fhackbot/lists"}