]> git.puffer.fish Git - matthieu/gru.git/commitdiff
add readme and example files
authorMatthieuCoder <matthieu@matthieu-dev.xyz>
Tue, 3 Jan 2023 10:46:43 +0000 (14:46 +0400)
committerMatthieuCoder <matthieu@matthieu-dev.xyz>
Tue, 3 Jan 2023 10:46:43 +0000 (14:46 +0400)
.gitignore
README.md [new file with mode: 0644]
bin/.gitkeep [new file with mode: 0644]
config/default.example.yml [new file with mode: 0644]
imgs/nova1.png [new file with mode: 0644]

index b2de36477bdfcb6510a1a0633f3a2797e0131e39..67a6e37ac96251b0a91d0de202e17d7715d7d2cc 100644 (file)
@@ -1,4 +1,6 @@
-config/
+config/*
+!config/default.example.yml
 dist/
-bin/
+bin/*
+!bin/.gitkeep
 node_modules/
\ No newline at end of file
diff --git a/README.md b/README.md
new file mode 100644 (file)
index 0000000..de6888e
--- /dev/null
+++ b/README.md
@@ -0,0 +1,75 @@
+# Nova quickstart
+
+This is a simple example of a nov base Discord bot inspired by the discord.js structure.
+
+## What you'll be doing
+
+This repo is a simple example of a bot developped using Nova. It's a simple bot that executes `ping` (ICMP Echo) requests using slash-commands.
+
+> Issuing arbitrary pings is not viable for a real discord bot, this is an example. Acces to your developement bot should be kept private to avoid abuse.
+
+<img src="imgs/nova1.png">
+
+## Running
+
+### Configuring your instance
+
+> The nova-all-in-one we are going to use is going to search this directory for a `default.{toml,json,json5,yml,yaml}`, feel free to use the configuration language you feel confortable with.
+
+You need to fill the configuration file and rename it to `default.yml` in the `config/` folder.
+
+### Getting nova running
+
+Download the nova-all-in-one server and put it in `bin/nova`.
+You can find the binary in the nova project releases page.
+
+> You can also use a full Nova instance running in `docker-compose` or an orchestrator such as [Kubernetes](https://kubernetes.io). Using a real nova instance, you'll need to store the configuration file safely depending on your orchestrator.
+
+The next step is starting nova:
+
+```bash
+RUST_LOG=info ./bin/nova
+```
+
+### Installing npm dependencies
+
+Since this example use node, you need node.js installed and a package manager, we recommend *yarn* or *pnpm*. 
+
+```bash
+# Using yarn
+yarn
+# Using pnpm
+pnpm install
+# Using npm
+npm install
+```
+
+### Registering commands
+
+Before starting your bot, you need to run the `register.ts` utility to register the commands wihin discord.
+
+> Registering commands is a one-time operation to tell discord which commands are available, you can read more about it [here](https://discord.com/developers/docs/interactions/application-commands#registering-a-command)
+
+```bash
+# Using yarn
+yarn register
+# Using pnpm
+pnpm run register
+# Using npm
+npm run register
+```
+
+### Starting the bot
+
+Finally, you can start the bot instance.
+
+```bash
+# Using yarn
+yarn start
+# Using pnpm
+pnpm run start
+# Using npm
+npm run start
+```
+
+**Everything should be running now!**
\ No newline at end of file
diff --git a/bin/.gitkeep b/bin/.gitkeep
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/config/default.example.yml b/config/default.example.yml
new file mode 100644 (file)
index 0000000..d4978c2
--- /dev/null
@@ -0,0 +1,53 @@
+gateway:
+  token: <token>
+  intents: 3276799
+  shard: 0
+  shard_total: 1
+
+rest:
+  discord:
+    token: <token>
+  server:
+    port: 8090
+    address: 0.0.0.0
+
+webhook:
+  discord:
+    public_key: <public key>
+    client_id: <user id>
+  server:
+    port: 8091
+    address: 0.0.0.0
+
+cache:
+  toggles:
+    - channels_cache
+    - guilds_cache
+    - guild_schedules_cache
+    - stage_instances_cache
+    - integrations_cache
+    - members_cache
+    - bans_cache
+    - reactions_cache
+    - messages_cache
+    - threads_cache
+    - invites_cache
+    - roles_cache
+    - automoderation_cache
+    - voice_states_cache
+
+ratelimiter:
+  
+
+# Prometheus monitoring configuration
+monitoring:
+  enabled: false
+  address: 0.0.0.0
+  port: 9000
+
+# Nats broker configuration
+nats:
+  host: nats
+
+redis:
+  url: redis://redis
diff --git a/imgs/nova1.png b/imgs/nova1.png
new file mode 100644 (file)
index 0000000..85361d7
Binary files /dev/null and b/imgs/nova1.png differ