You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Discord bot that lets server members give each other karma points via mentions.
3
+
A Discord bot for giving and tracking karma points across server members and teams.
4
4
5
5
## How It Works
6
6
7
+
### Giving Karma
8
+
7
9
Mention a user followed by `++` (two or more plus signs) to give them karma:
8
10
9
11
```
10
-
@alice +++
12
+
@alice +++ # gives Alice 3 karma
13
+
@bob +++++ # gives Bob 5 karma
14
+
```
15
+
16
+
### Removing Karma
17
+
18
+
Use `--` (two or more minus signs) or em dashes to remove karma:
19
+
20
+
```
21
+
@alice --- # removes 3 karma
22
+
@alice — # removes 2 karma (em dash counts as 2)
23
+
@alice ——— # removes 6 karma
11
24
```
12
25
13
-
This gives Alice 3 karma. The bot replies with their updated total.
26
+
### Team Karma
27
+
28
+
Mention a team role to give karma to all members of that team:
29
+
30
+
```
31
+
@Frontend +++ # gives +3 karma to every member with the Frontend role
32
+
```
33
+
34
+
Team role karma allows self-karma (if you're on the team) and bypasses the global rate limit, but per-user limits still apply.
35
+
36
+
### Rate Limits
14
37
15
-
### Rules
38
+
-**Global limit** — max total karma you can give/take in a rolling interval (`LIMIT_MAX_KARMA_SEND` / `LIMIT_MIN_KARMA_SEND`)
39
+
-**Per-user limit** — max karma you can give/take to the same person per interval (`LIMIT_MAX_KARMA_USER_SEND` / `LIMIT_MIN_KARMA_USER_SEND`)
40
+
- The bot tells you exactly why karma was capped (per-user limit, global budget, or rate limited with reset time)
16
41
17
-
- Only members with designated roles (configured via `KARMA_USER_ROLE_IDS`) can give and receive karma
18
-
- You cannot give karma to yourself
19
-
- Karma giving is rate-limited to `MAX_KARMA_SEND` points per `MAX_KARMA_SEND_INTERVAL`
20
-
- Karma accumulates in time-based windows (semiannual by default), configurable via a `dateutil` rrule
42
+
### Karma Windows
43
+
44
+
Karma accumulates in configurable time-based windows (semiannual by default). When a window ends, the leaderboard is automatically posted and a new window begins. Historical windows are preserved.
45
+
46
+
## Commands
47
+
48
+
### Karma
49
+
50
+
| Command | Description |
51
+
|---|---|
52
+
|`/leaderboard`| View the karma leaderboard (with period selector dropdown) |
53
+
|`/team-leaderboard`| View the team karma leaderboard |
54
+
|`/ping`| Check bot latency |
55
+
56
+
### Configuration (requires Manage Server)
57
+
58
+
| Command | Description |
59
+
|---|---|
60
+
|`/config set-leaderboard-channel #channel`| Set where leaderboards are posted on window rollover |
61
+
|`/config add-karma-role @role`| Add a role that can give and receive karma |
62
+
|`/config remove-karma-role @role`| Remove a karma role |
63
+
|`/config view-karma-roles`| List all karma roles |
64
+
|`/config add-team-role @role`| Add a role as a team for the team leaderboard |
65
+
|`/config remove-team-role @role`| Remove a team role |
66
+
|`/config view-team-roles`| List all team roles |
67
+
68
+
When no karma roles are configured, everyone can use the bot.
21
69
22
70
## Project Structure
23
71
24
72
```
25
73
src/
26
-
bot.py # Entry point
27
-
core/config.py # Constants and karma window rule
74
+
bot.py # Entry point, error handler, persistent views
75
+
core/
76
+
config.py # Rate limits, karma window rrule
77
+
checks.py # @has_karma_role() decorator + member check
0 commit comments