The Accountant manages Points in Discord servers. In the Eco Discord, Points are "for research purposes only," as we often say — but they have become the lifeblood of our community. We grant Points to members, and then anyone can send those Points to each other. They’ve become an incredible, vibrant transactional layer. Points can represent anything you and your community want them to — a reward, a thank you, a reputation layer, a place in line... anything that can be represented by a number.
(Note: We’ve intentionally added friction to getting into the Eco community, but here’s a hint: having everyone’s favorite 🦊 unlocks a different signup flow on our site. Or you can just answer the riddle correctly. Or there might be other ways to get in, too...)
There are two ways to use The Accountant:
-
Deploy The Accountant into your own server, with your own Points, separate from Eco Points. If you do this, you'll be able to grant Points freely — as many as you want. But they won't have any link to Eco Points. To do this, follow the instructions lower in this README under "Set up your own Accountant."
-
Perhaps even cooler: invite The Accountant into your server using Eco Points. If you do this, members of the Eco Discord can (and will) come over and already have Points in your server. And you can request grants of Eco Points from the Eco community for you to re-distribute to your own community. The Points will persist across every server that has invited The Accountant.
To request grants of Eco Points to distribute to your community, hop into this Discord channel and introduce yourself. You'll need to apply and be approved by the Eco Community.
Being a part of the Eco network is powerful. We're building a coalition of projects, all allowing the same Points to move across different servers and serve as a pro-social transactional layer. We’ll have embassies between different Discord communities, cross-community collaboration, and more.
If you’re even vaguely interested in the idea of adding Eco Points to your server, getting grants of Points, and enabling that cross-community interaction and transaction layer, here’s a link to join a Discord channel where you can chat with us (and we can give you access to the rest of the Eco Discord). We’d love to discuss.
Again, here’s the link to add The Accountant to your server and use Eco Points.
For more about The Accountant Bot and all the rest of the bots open-sourced by the Eco Community, check out this post. There's a member management dashboard, a bot to manage role assignment based on invite links, bots that let you stake and enter sweepstakes with points, and much more.
- Create a MySQL database for the bot. Inside the
mysql
command line client:
CREATE DATABASE accountant;
- Select the database and generate the tables using the
db.sql
file:
USE accountant
source db.sql
-
Rename the
.env.sample
file in the root folder to.env
and fill it with your bot token and database details. -
To add the bot to servers, go to the Discord Developer Portal, open your bot, click on
OAuth2
>URL Generator
in the sidebar, enable thebot
scope, enable theSend Messages
andManage Messages
permissions, then use the generated URL.The
Manage Messages
permission is required for deleting commands that were used in the wrong channel.After that you can click on
Bot
in the sidebar, and enablePublic Bot
if you want to allow anyone to add the bot to their own servers. -
In your Discord server, create four channels; one named
#check-your-points
for users to check their points, one named#points-log
for logging all point transactions from all servers, one named#grants-log
for logging grants only, and one named#eco-server-points-log
for logging transfers made inside your server only. These names can be customized by editingconstants.ts
. -
Create an emoji for displaying point amounts.
-
(Optionally) create roles for point milestones (e.g. "0-50 points", "50-250 points")
-
(Optionally) create a Slack webhook for logging grants: https://api.slack.com/messaging/webhooks
-
Rename the
config_sample.ts
file in thesrc
folder toconfig.ts
then use the ID of your server inMAIN_GUILD
and fill the rest using the IDs of the emote and roles as well as the Slack webhook created in steps 5, 6 and 7. -
Install dependencies:
npm install
- Compile TypeScript:
npm run build
- And finally, run the bot:
npm run start
Do the setup instructions above, then create a test database using steps 1 and 2, and add its name to .env
:
DB_DATABASE_TEST="test_db_name"
Use this command to run the tests:
npm run test
The bot offers the following commands for your users. The admin commands are only available if you are hosting your own deployment of the bot.
Input is specified with <value>
. Do not include the < >
when executing the command. Make sure to include your chosen prefix before the command (the default is !
.)
help
- Returns a list of commands which can be used.leaderboard <number>
- Returns a list of the top point holders. It has a maximum of 25. No input will default to 10.ping
- Returns the time it took the bot to respond to a request.points <@user>
- Returns the amount of points the chosen user has. If no user is mentioned, it will return the points of the message sender.send <@user> <number>
- Sends the mentioned users the specified amount of points. Multiple users can be specified before the number of points.
admin add <@user>
- Adds a user as an admin.admin remove <@user>
- Removes admin privieleges from a user.admin list
- Provides a list of current admins.admin stats
- Returns the amount of points and grants distributed to users.grant <@user> <number>
- Grants the mentioned users the specified amount of points. Multiple users can be specified before the number of points.
Hop into this Discord channel and introduce yourself and we can help out (and give you access to the rest of the Eco Discord).