Skip to content

jsw08/DCBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jsw's slaafje - my personal Discord bot

TypeScript Deno JS Discord

A relatively simple Discord bot with random commands I needed, made with Deno, TS and Discord.JS.

Important

This bot was made as a learning project that I could use for personal use with friends. I have not made it user friendly to install it yourself. It is however licensed under the unlicense so you may use the code however you like.

Commands

Command Description Parameters Availability Preview
/ping Responds with "pong" None Everywhere {6004959A-4792-4FAB-B937-03490B4EF3C0}
/remind Sends you a reminder in a dm. - message: REQUIRED string; the message you'd like to send yourself.
-date: REQUIRED string; either iso date or natural english date. Parsed using chrono, meaning that you can enter in 2h or tomorrow.
Everywhere {ED5756E1-F46B-43FD-80DF-CCD2807DAD26} {AE21463D-A463-4AA0-B8A7-F8903BA798DA}
/time Command to generate Discord Timestamps - time: REQUIRED string; same as /remind.
- type: REQUIRED autocompleted string; several options for the timestring, including relative, full date etc...
Everywhere {82E2C7C6-04AC-43CB-9096-FEDC6951A709}
/say Will say something as the bot. You must specify one of these parameters.
- content: string; the message.
- json: string; parsed json, use this to add embeds.
Everywhere {38987594-2F36-483A-BF90-7824D85C7115}
/coc Creates an ClashOfCode game and provides controls to start the game, and to make a new session. - languages: REQUIRED autocompleted string; the allowed programming languages for the clash, comma seperated.
- gamemodes: REQUIRED autocompleted string; different combinations of gamemodes.
Everywhere {8A215586-3A6B-4EBE-98A1-10D46FF16E40}
Typst This set of commands allow you to type and compile typst code in discord. Useful for those moments where you're explaining math to someone. Common parameters:
- transparant: boolean; it'll set the background color of the png to transparant. Only compatible with discord dark mode as the text color will be set to white.
- file: boolean; it'll attach the typst code as file.
Everywhere image
- /typst inline You can type one line of typst code within the input itself and it'll generate a picture out of it. - code: REQUIRED string; the typst code.
+ common parameters
Everywhere {E0F0DFD8-7853-4E69-91AB-6388FA4B3A5C}
- /typst multiline A modal with a text input will be opened once you run this command so you can type multiple lines of typst code (up to 4000 chars) + common parameters Everywhere {9AD7B4E8-E139-43B7-890B-1D84F2A3E918}
Typescript Eval Runs the provided typescript code. Common parameters:
- output: boolean; if enabled the bot will respond with the input+output of your code in public chat (not ephemeral).
Nowhere (only configured userids may use it.) {B372D0B4-8DCB-4837-81A6-19178854872F}
- /ts inline Allow's for one line of typescript code. So you can either just run simple or minified code. - code: REQUIRED string; ts code.
+ common parameters
Nowhere {7B5BFDEB-31DE-448C-B9BF-AAFF07107176}
- /ts multiline Opens a modal for longer codesnippets (again max length of 4000 characters). + common parameters Nowhere {0383FEBD-BEDC-4AFC-A041-7AD657F83914}
Sexy This collection of commands allows me and my friends to - Upload unappealing pictures of eachother to my server. - Send them (within my discord server) using my bot. This allows us to have a central place to store funny pictures of eachother. Common parameters:
- nickname: REQUIRED autocompleted string; the nickname under which the photos are stored
- public: bool; makes the message not ephemeral.
At specified guilds {3BE5E9E8-78DB-46C2-82A2-E6566A9346A3}
- /sexy carousel Displays the pictures in a 4x4 grid with scrolling buttons on the bottom - page: autocompleted number; specifies the page the carousel should start at.
+ common parameters
At specified guilds {AFEF4549-058D-4A2A-9728-069BC10B9E88}
- /sexy image Allows you to pick one image to send. - image: REQUIRED autocompleted string; specifies the iamge that should be displayed.
+ common parameters
At specified guilds {FC525F05-26AF-428C-AB30-12AB293C6206}
- /sexy-upload Uploads the specified image to the server's filesystem. - nickname: REQUIRED autocompleted string; the nickname under which the photos are stored
- filename: REQUIRED string; a name that should describe the image.
- image: REQUIRED asset; the image file.
At specified guilds {ABC3995A-DB63-4DB6-BB42-10251DA4FD53}
LastFM These commands show what song you or a lastfm user is currently playing None Everywhere {C47A3CDE-C134-4209-A861-10E71161B4F9}
/fm np Gets the currently playing song of either your lastfm username or the provided one. - username: string; overwrites the lastfm username. Everywhere {5432B1AF-6237-499C-8DE7-3C5778C2B30F}
/fm set Sets your lastfm user. It alsoc ckecks if the provided username exists. - username: REQUIRED string; the username that will be set in the database. Everywhere {93A91DDB-A095-4F93-9B5A-A40F5768E025}

Installation

Prerequisites

  • Required
    • Deno
    • Git
    • Port forwarding / a different solution to get the web server online.
  • Optional
    • Typst

Installation

  • git clone https://github.com/jsw08/dcbot
  • cd dcbot
  • deno i

Configuration

This program works using dotenv. So you can either place a .env file in the project root, or set the environment variables. See the template file.

Usage

Screenshots and recordings

{35FE9E78-CABA-41B1-B861-940C94C80203}

Sexy mfs

sexy-demo.mp4

Utilities

unknown_2024.12.04-16.26.mp4

About

Jsw's slaafje

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •