Skip to content

Commit

Permalink
feat: init
Browse files Browse the repository at this point in the history
  • Loading branch information
isabelroses committed Mar 18, 2024
0 parents commit f53de46
Show file tree
Hide file tree
Showing 36 changed files with 8,203 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DISCORD_TOKEN=a
CLIENT_ID=b
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
.vscode/
.env
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 isabelroses

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Blahaj

<h1 align="center">
<img src="assets/BigBlobhajHug.svg" width="128" height="128" /><br />
Blåhaj
</h1>

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.

## Installation

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:

Then navigate to the file and run the following command:
```bash
npm install
```
This will install all the dependencies that blahaj needs to run.

## Usage

To run blahaj
```bash
node src/index.js
```


## Thanks

Thanks to [discord.js](https://discord.js.org/#/) for making this bot possible.

Thanks to this [reddit post](https://www.reddit.com/r/BLAHAJ/comments/s91n8d/some_blahaj_emojis/) for the emojis.
6,696 changes: 6,696 additions & 0 deletions assets/BigBlobhajHug.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{buildNpmPackage}:
buildNpmPackage {
pname = "blahaj";
version = "0.1.0";

src = ./.;

dontNpmBuild = true;

npmDepsHash = "sha256-mRmu2UIJTWj4d/UypUAM4+3Q8cbuVpazMuv4b21Yxho=";
}
26 changes: 26 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
description = "Blahaj";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
};

outputs = {
self,
nixpkgs,
}: let
systems = ["x86_64-linux" "aarch64-linux"];
forEachSystem = nixpkgs.lib.genAttrs systems;

pkgsForEach = nixpkgs.legacyPackages;
in {
packages = forEachSystem (system: {
default = pkgsForEach.${system}.callPackage ./default.nix {};
});

devShells = forEachSystem (system: {
default = pkgsForEach.${system}.callPackage ./shell.nix {};
});

nixosModules.default = import ./module.nix self;
};
}
26 changes: 26 additions & 0 deletions module.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
self: {
pkgs,
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption;
in {
options.services.blahaj.enable = mkEnableOption "blahaj";

config = mkIf config.services.blahaj.enable {
systemd.services."blahaj" = {
description = "blahaj";
after = ["network.target"];
wantedBy = ["multi-user.target"];
path = [pkgs.nodejs];

serviceConfig = {
Type = "simple";
DynamicUser = true;
ExecStart = "node ${self.packages.${pkgs.stdenv.hostPlatform.system}.default}/lib/node_modules/blahaj";
Restart = "always";
};
};
};
}
Loading

0 comments on commit f53de46

Please sign in to comment.