This is a Discord application for experimenting ideas on and serve our community needs.
Firstly what you want to do is clone this repository:
git clone https://github.com/Hydractify/hydractify.git
From here you will configure the application with config.toml
, you can use config.example.toml
as a reference. Here you will set:
- The application's token (
token
); - The database URL (
database_url
), i.e.postgres://username:password@localhost/database_name
; - Module configuration.
Once that's done, you need to install diesel_cli
for automatically generating typings and running our SQL to make sure all tables are configured. You can install it through cargo:
cargo install diesel_cli --no-default-features --features postgres
Once that's done, ensure it's binary in your $PATH
then run:
diesel migration run
Now you can just run the application! If you're not familiar with Rust, you can run it through your terminal with:
cargo run
This module is configured via [self_roles]
in config.toml
, which has two fields:
enabled
- Whether the module is enabled or not. The commands are still registered, maybe they shouldn't.
channel_id
- The ID of the channel where the self role message should be deployed.
When enabled and the message is deployed then when a Discord user interacts with the module they will have that certain role added to them or removed.
To configure and manage the message with the self assignable roles you must use the /selfrole
slash commands, these being:
/selfrole show
- Lists the registered self assignable roles.
/selfrole deploy
- Deploys the message with the self assignable roles, optionally receiving a message ID to edit an existing one.
/selfrole cleanup
- Removes from the list all roles that have been deleted.
/selfrole remove
- Removes a specific role from the self assignable role list.
/selfrole add
- Adds a specific role into the self assignable role list.
This module is configured via [starboard]
in config.toml
, which has four fields:
enabled
- Whether the module is enabled or not.
channel
- The channel that starboard messages should go to.
emojis
- An array containing the emotes that trigger a starboard message, these can be an UTF-8 character like
⭐
or a custom emote like<a:a_kirbyStar:894087344909606912>
.
- An array containing the emotes that trigger a starboard message, these can be an UTF-8 character like
threshold
- How many emotes are needed to trigger a starboard message.
This implementation is heavily based off of etternabot, it was a great starting point for me to understand how poise
and serenity
work!