6 releases
0.3.1 | Apr 10, 2023 |
---|---|
0.3.0 | Apr 6, 2023 |
0.1.11 | Apr 4, 2023 |
#44 in #discord-bot
83 downloads per month
115KB
2.5K
SLoC
Tara
Tara is a modern, free, open-source, self-hostable Discord bot.
Tara works on Linux and macOS.
Installation
Tara can be installed in 2 simple steps:
- Install executable
If your desired platform isn't seen below, please open an issue.
Linux
The recommended way to install Tara is by way of a package manager. If using
cargo install
, some dependencies won't automatically be installed. You'll need to installsqlite3
previous to running the instructions. On Debian and Ubuntu systems the required package islibsqlite3-dev
, on Arch and related systems it'ssqlite
.
Distribution Repository Instructions Any crates.io cargo install tara --locked
macOS
The recommended way to install Tara is by way of a package manager.
Repository Instructions crates.io cargo install tara --locked
- Configure
Before the bot can be started successfully, it needs to be configured.
Tara has an interactive setup subcommand, tara config init
.
$ tara config init --help
tara-config-init 0.2.0
Create configuration files with a user-provided configuration
USAGE:
tara config init
FLAGS:
-h, --help Prints help information
tara config init
will create a configuration file in the appropriate location. If this needs to
be modified it can be.
The file's content's should be the same regardless of operating system, but the location in the file system will be different.
Linux
Tara looks for a configuration file in this order:
$XDG_CONFIG_HOME/Tara/tara.toml
or$HOME/.config/Tara/tara.toml
/etc/tara.d/tara.toml
macOS
Tara's configuration file is located here:
$HOME/Library/Application Support/com.github.El-Wumbus.Tara/tara.toml
The configuration file should look similarly to below:
randomErrorMessage = false
[secrets]
# Discord bot token
token = "<DISCORD_TOKEN>"
# API key from currencyapi.com.
currencyApiKey = "<CURRENCYAPI.COM>" # Optional
All accepted keys:
-
randomErrorMessage
- This key allows for error messages to be selected randomly from a set loaded from a JSON document. If setting this key totrue
, it will look in the default locations for aerror_messages.json
file. If enabled and the file cannot be parsed (because it doesn't exist or is invalid), Tara will continue with the default error messages. Another choice is to set this to the path of the error messages file. A value offalse
will use a singular, static error message.The default location for the error messages file is system dependant.
Linux
Tara will look in these locations for an existing file.
$XDG_CONFIG_HOME/Tara/error_messages.json
or$HOME/.config/Tara/error_messages.json
/etc/tara.d/error_messages.json
macOS
Tara will look here for an existing file:
$HOME/Library/Application Support/com.github.El-Wumbus.Tara/error_messages.json
-
direct_message_cooldown
- This optional key is to set the minimum duration, in seconds, to allow between running commands in a direct message. The default is3
. -
secrets.token
- The discord token can be aquired according to Building your first Discord app. -
secrets.currencyApiKey
- ThecurrencyApiKey
is an optional key to enable the currency conversion feature. This can be aquired from currencyapi.com. The feature will, at most, refresh every six hours. This means the feature will never need a paid API key.
Using
Running
To start Tara, use the tara daemon
command. If no errors or warnings occur, Tara's stdout and stderr will be blank. If Tara has a proper Discord token, then it's ready to use.
$ tara daemon --help
tara-daemon 0.2.0
Start Tara
USAGE:
tara daemon [OPTIONS]
FLAGS:
-h, --help Prints help information
OPTIONS:
--config <config> Specify a configuration file to use instead of the default
Discord Commands
Name | Description | Usable in DMs | Permissions |
---|---|---|---|
define |
Defines an English word | Yes | NONE |
wiki |
Searches for a wikipedia page and returns a summary | Yes | NONE |
random coin |
Flips a coin | Yes | NONE |
random cat |
Gives a random cat photo | Yes | NONE |
random dog |
Gives a random dog photo | Yes | NONE |
random quote |
Gives a random quote | Yes | NONE |
random number |
Generates a random number between optional low and high bounds (inclusive) | Yes | NONE |
search duckduckgo |
Search DuckDuckGo for a search term. Results are censored. | Yes | NONE |
conversions temperature |
Convert one temperature unit to another. Supports celsius, kelvin, and fahrenheit | Yes | NONE |
conversions currency |
Convert from one currency to another. Only enabled when secrets.currencyApiKey is set. |
Yes | NONE |
settings set * |
Set settings for the current guild | No | MANAGE_GUILD |
settings view * |
See current guild settings | No | MANAGE_GUILD |
role add |
Give yourself a self-assignable role | No | NONE |
role remove |
Remove a self-assignable role | No | NONE |
role list |
List all self-assignable roles | No | NONE |
Dependencies
~68MB
~1.5M SLoC