discord-bot
discord-bot copied to clipboard
Svelte Bot - Cybernetically enhanced discord servers
Welcome to the repo for the official Svelte Discord bot!
Documentation
Commands
-
Bookmark
- Message command that lets you save a reference to a message from the server in your DMs. Right click any message then go to
Appsin the context menu to use.
- Message command that lets you save a reference to a message from the server in your DMs. Right click any message then go to
-
Docs
/docs svelteor/docs sveltekit: Quickly search the Svelte or SvelteKit docs and send a link in the chat./mdnSame as above but for the MDN web docs.
-
Github
/discussion,/issueor/prsearch for matching discussions, issues or PRs in some of thesveltejs/*repositories and send links to the results in the chat.
-
Tags: Tags are a way to store and reuse frequent responses so that you don't have to look up and type them out every time.
/tagSends an existing tag to the chat./tags createCreate a tag. You must have the threadlord role to use it./tags updateEdit a tag. You must be the author of the tag to use it./tags deleteDelete a tag. You must be the author of the tag or have the threadlord role.
-
Threads: These are commands to manage the autothreads created by the bot. They can be used by the person who initiated the thread or by people with the threadlord role.
/thread rename/thread solveRenames the thread to have a green checkmark at the start and sets the archive duration to 1hr./thread archiveArchive an active thread without marking it as solved./thread reopenReopen a thread that's been accidentally marked as solved.
-
Stats: Currently disabled commands which let you see how many cookies‡ a user has and the server leaderboard.
‡ internet points for solving threads, not the evil tracking ones
Stack
Click on the links below to view the documentation on the different parts of the bot's tech stack:
Config
-
The bots main config is located at src/config.ts, by default it will have the Svelte Discord & Testing configurations.
-
All secrets should be in a
.envfile, the template/example can be found here.
Contributing
All contributions are welcome, please try and make an issue first since most new features might warrant a discussion beforehand. Bug fixes probably won't need an issue and direct pull requests are ok for them.
Running for development
-
Once you have the bot cloned and have run
pnpm installthen you need to make a .env file and fill out the fields:cp .env.example .env -
Run the database with
pnpm supabase start -
Run the bot with
pnpm dev
Code Conventions
Since there is no user facing code, prefer snake_case for variables and function names wherever possible. Local constants follow the same, whereas global constants should be in SCREAMING_SNAKE_CASE.
Deploying
The bot uses the tsm module loader to transpile its Typescript code on the fly so there's no build step involved.
pnpm install
pnpm start