silly goober bot

init v2

+67 -55
+11
Cargo.toml
··· 1 + [package] 2 + name = "blahaj" 3 + version = "0.0.1" 4 + license = "MIT" 5 + authors = ["Isabel Roses <isabel@isabelroses.com>"] 6 + description = "the resident discord bot of :3" 7 + readme = "README.md" 8 + homepage = "https://github.com/isabelroses/blahaj" 9 + repository = "https://github.com/isabelroses/blahaj" 10 + keywords = ["discord", "bot", "serenity"] 11 + edition = "2021"
+3 -8
README.md
··· 5 5 Blåhaj 6 6 </h1> 7 7 8 - Blahaj is a simple discord bot that is designed to do anything that you want it to do. It is written in JavaScript and uses the discord.js library. 8 + Blahaj is a discord bot that is designed to do anything that you want it to do. It is written in JavaScript and uses the discord.js library. 9 9 10 10 ## Installation 11 11 12 - To install blahaj, you need to have node.js installed. You can download it from [here](https://nodejs.org/en/download/). Once you have node.js installed, you can install blahaj by running the following command: 13 - 14 12 Then navigate to the file and run the following command: 15 13 ```bash 16 - npm install 14 + go mod tidy 17 15 ``` 18 16 This will install all the dependencies that blahaj needs to run. 19 17 ··· 21 19 22 20 To run blahaj 23 21 ```bash 24 - node src/index.js 22 + go run . 25 23 ``` 26 - 27 24 28 25 ## Thanks 29 - 30 - Thanks to [discord.js](https://discord.js.org/#/) for making this bot possible. 31 26 32 27 Thanks to this [reddit post](https://www.reddit.com/r/BLAHAJ/comments/s91n8d/some_blahaj_emojis/) for the emojis.
+13 -6
default.nix
··· 1 - {buildNpmPackage}: 2 - buildNpmPackage { 1 + { lib, rustPlatform }: 2 + let 3 + p = (lib.importTOML ./Cargo.toml).package; 4 + in 5 + rustPlatform.buildRustPackage { 3 6 pname = "blahaj"; 4 - version = "0.1.0"; 7 + inherit (p) version; 5 8 6 9 src = ./.; 10 + cargoLock.lockFile = ./Cargo.lock; 7 11 8 - dontNpmBuild = true; 9 - 10 - npmDepsHash = "sha256-hjExjokjK3HZssWOkARDJY1m0+SxsQsxT2WaoBYqqe8="; 12 + meta = { 13 + inherit (p) description homepage; 14 + license = lib.licenses.mit; 15 + maintainers = with lib.maintainers; [ isabelroses ]; 16 + mainProgram = "blahaj"; 17 + }; 11 18 }
+23 -18
flake.nix
··· 1 1 { 2 2 description = "Blahaj"; 3 - inputs = { 4 - nixpkgs.url = "github:NixOS/nixpkgs"; 5 - }; 6 3 7 - outputs = { 8 - self, 9 - nixpkgs, 10 - }: let 11 - systems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"]; 12 - forEachSystem = nixpkgs.lib.genAttrs systems; 4 + inputs.nixpkgs.url = "github:NixOS/nixpkgs/"; 5 + 6 + outputs = 7 + { nixpkgs, ... }: 8 + let 9 + systems = [ 10 + "x86_64-linux" 11 + "aarch64-linux" 12 + "x86_64-darwin" 13 + "aarch64-darwin" 14 + ]; 13 15 14 - pkgsForEach = nixpkgs.legacyPackages; 15 - in { 16 - packages = forEachSystem (system: { 17 - default = pkgsForEach.${system}.callPackage ./default.nix {}; 18 - }); 16 + forAllSystems = 17 + function: nixpkgs.lib.genAttrs systems (system: function nixpkgs.legacyPackages.${system}); 18 + in 19 + { 20 + packages = forAllSystems (pkgs: rec { 21 + default = blahaj; 22 + blahaj = pkgs.callPackage ./default.nix { }; 23 + }); 19 24 20 - devShells = forEachSystem (system: { 21 - default = pkgsForEach.${system}.callPackage ./shell.nix {}; 22 - }); 23 - }; 25 + devShells = forAllSystems (pkgs: { 26 + default = pkgs.callPackage ./shell.nix { }; 27 + }); 28 + }; 24 29 }
+14 -23
shell.nix
··· 1 1 { 2 - eslint_d, 3 - prettierd, 2 + clippy, 3 + rustfmt, 4 4 callPackage, 5 - nodejs-slim, 6 - writeShellScriptBin, 7 - }: let 8 - mainPkg = callPackage ./default.nix {}; 9 - mkNpxAlias = name: writeShellScriptBin name "npx ${name} \"$@\""; 5 + rust-analyzer, 6 + }: 7 + let 8 + mainPkg = callPackage ./default.nix { }; 10 9 in 11 - mainPkg.overrideAttrs (oa: { 12 - nativeBuildInputs = 13 - [ 14 - eslint_d 15 - prettierd 16 - nodejs-slim 17 - (mkNpxAlias "tsc") 18 - (mkNpxAlias "tsserver") 19 - ] 20 - ++ (oa.nativeBuildInputs or []); 21 - 22 - shellHook = '' 23 - eslint_d start # start eslint daemon 24 - eslint_d status # inform user about eslint daemon status 25 - ''; 26 - }) 10 + mainPkg.overrideAttrs (oa: { 11 + nativeBuildInputs = [ 12 + # Additional rust tooling 13 + clippy 14 + rustfmt 15 + rust-analyzer 16 + ] ++ (oa.nativeBuildInputs or [ ]); 17 + })
+3
src/main.rs
··· 1 + fn main() { 2 + println!("Hello, world!"); 3 + }