Skip to content
This repository was archived by the owner on Apr 24, 2024. It is now read-only.

Commit 9999449

Browse files
authored
Merge pull request #1 from counting-bot/dev
First release
2 parents 681d461 + 6018461 commit 9999449

34 files changed

+1941
-1
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
node_modules/
3+
package-lock.json

Counting.code-workspace

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"folders": [
3+
{
4+
"path": "."
5+
}
6+
]
7+
}

README.md

+72-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,72 @@
1-
# bot
1+
# Counting
2+
A highly customizable counting bot created by [numselli](https://github.com/numselli/).
3+
4+
[Privacy Policy](https://counting.numselli.xyz/privacy) - [Support Server](https://counting.numselli.xyz/support)
5+
6+
7+
## Before you continue (Notice on Open Source status of Counting)
8+
The code in this repository contains a slimmed down version of my [counting bot](https://counting.numselli.xyz/). This version of the bot is intended to be used in a small number of guilds and has some functionality removed most notably:
9+
- Voting to earn saves
10+
- Website
11+
- API
12+
- All [premium](https://counting.numselli.xyz/premium) features
13+
14+
There are two important expectations to set for self-hosting this bot:
15+
- Expect limited support in the support server due to the complexities of self-hosting.
16+
- Expect braking changes in all releases. I will try to minimize breaking changes, but I am primarily focusing on the main bot where I have full control over the effects of my changes.
17+
18+
Using this code for personal use is acceptable however monetizing this project is not, if you do wish to monetize this code please reach out to me on discord (`numselli#6964`).
19+
If you would like to give back to the project consider making a pull request, [donating](https://www.paypal.com/paypalme/numselli), or [subscribing to a premium plan](https://counting.numselli.xyz/premium).
20+
21+
\- numselli Counting Maintainer
22+
23+
## Installing and Setup
24+
The following steps will help you get Counting up and running on your computer.
25+
1. Install Prerequisites
26+
- Install [Docker](https://docs.docker.com/engine/install/) and [Docker compose](https://docs.docker.com/compose/install/)
27+
- Clone this repository to the system you want to run the bot
28+
```
29+
git clone https://github.com/counting-bot/bot.git
30+
```
31+
- [Create a new discord bot](https://www.xda-developers.com/how-to-create-discord-bot/#how-to-create-and-add-a-discord-bot-to-your-server). **Make sure you have MESSAGE CONTENT INTENT under Privileged Gateway Intents enabled.**
32+
2. Create docker volumes
33+
1. Make two directories
34+
- static
35+
- database
36+
- cache
37+
2. Modify and run the following three commands
38+
- ```
39+
docker volume create --driver local \
40+
--opt type=non \
41+
--opt o=bind\
42+
--opt device=/<PATH OF STATIC DIR>\
43+
CountingStatic
44+
```
45+
- ```
46+
docker volume create --driver local \
47+
--opt type=non \
48+
--opt o=bind\
49+
--opt device=/<PATH OF DATA BASE DIR>\
50+
CountingDB
51+
```
52+
- ```
53+
docker volume create --driver local \
54+
--opt type=non \
55+
--opt o=bind\
56+
--opt device=/<PATH OF CACHE DIR>\
57+
cache
58+
```
59+
3. Copy and edit the config file
60+
- Copy `settings.example.mjs` into the static folder that you made in step 2
61+
- Replace `726515812361437285` with your discord userid
62+
- Replace `TOKEN_HERE` with the discord bots token
63+
4. Run the bot
64+
- Open this repository in a terminal of your choosing and run
65+
```
66+
sudo docker-compose up -d
67+
```
68+
5. Invite the bot to your server using this link (remember to replace `726560538145849374` with your bot's id) `https://discord.com/oauth2/authorize?client_id=726560538145849374&permissions=3136&scope=bot%20applications.commands`
69+
6. Link a counting channel using the `/linkchannel` command
70+
71+
## License
72+
This repository is licensed under the [Commons Clause License](https://commonsclause.com/). Monetized use of this repository is strictly disallowed.

docker-compose.yml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
version: "3"
2+
3+
volumes:
4+
CountingStatic:
5+
external: true
6+
CountingDB:
7+
external: true
8+
cache:
9+
external: true
10+
11+
12+
services:
13+
bot:
14+
restart: unless-stopped
15+
build: ./src
16+
depends_on:
17+
- postgres
18+
- cache
19+
volumes:
20+
- CountingStatic:/static
21+
container_name: Bot
22+
23+
postgres:
24+
restart: unless-stopped
25+
image: postgres:12-alpine
26+
environment:
27+
- POSTGRES_USER=countingbot
28+
- POSTGRES_PASSWORD=-YnZtyQ<|Te{0X^W
29+
- POSTGRES_DB=countingdb
30+
ports:
31+
- 5436:5432
32+
volumes:
33+
- ./schema.postgresql.sql:/docker-entrypoint-initdb.d/schema.postgresql.sql:ro
34+
- CountingDB:/var/lib/postgresql/data
35+
container_name: DB
36+
37+
cache:
38+
restart: unless-stopped
39+
image: redis:7.0.7-alpine
40+
ports:
41+
- '6379:6379'
42+
command: redis-server --loglevel warning
43+
volumes:
44+
- cache:/data
45+
container_name: Cache

0 commit comments

Comments
 (0)