-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
202 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Config | ||
|
||
Sandpiper can be configured with a JSON file at `sandpiper/config.json`. | ||
[sandpiper/config_example.json](sandpiper/config_example.json) contains | ||
default values and can be used as a template. `bot_token` is the only required | ||
field. | ||
|
||
## Config Fields | ||
|
||
### Root | ||
|
||
Fields in the root JSON object. | ||
|
||
Key | Value | ||
--- | ----- | ||
`bot_token` *(string)* | Your [Discord bot's](https://discord.com/developers/docs/topics/oauth2#bots) access token | ||
|
||
### Bot | ||
|
||
Fields in `(root).bot` which describe the bot itself. See also | ||
the [discord.py bot documentation](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#bot) | ||
for more info on how these fields are used. | ||
|
||
Key | Value | ||
--- | ----- | ||
`command_prefix` *(string)* | What users type to run a command | ||
`description` *(string)* | Description of the bot (used in help messages) | ||
|
||
### Logging | ||
|
||
Fields in `(root).logging` which describe how logging is performed. Sandpiper | ||
uses rotating logging to write log files which rotate in specified intervals. | ||
See also the | ||
[TimedRotatingFileHandler documentation](https://docs.python.org/3/library/logging.handlers.html#timedrotatingfilehandler) | ||
for more info on how these fields are used. | ||
|
||
Key | Value | ||
--- | ----- | ||
`sandpiper_logging_level` *(string)* | Sandpiper's most verbose logging level. Must be one of ('DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'). | ||
`discord_logging_level` *(string)* | discord.py's most verbose logging level. Must be one of ('DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'). | ||
`output_file` *(string)* | Absolute or relative (to sandpiper module) filepath to output logs to (including filename) | ||
`when` *(string)* | Type of time interval for rotating log files. Must be one of ('S', 'M', 'H', 'D', 'midnight') | ||
`interval` *(integer)* | Number of specified time intervals that must elapse before rotating to a new log file | ||
`backup_count` *(integer)* | Number of backup log files to retain (deletes oldest after limit is reached) | ||
`format` *(string)* | Format string used when writing log messages ([format string reference](https://docs.python.org/3/library/logging.html#logrecord-attributes)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
# Default unit mappings | ||
|
||
When no output unit is specified, Sandpiper will try to convert to another | ||
related unit. Some units convert two ways (Celsius <-> Fahrenheit), and others | ||
map only one way for simplicity (Kelvin -> Celsius). | ||
|
||
## Two-way | ||
|
||
The units in each row will convert to each other. | ||
|
||
### Length | ||
Metric | Imperial | ||
------ | -------- | ||
Kilometre `km` | Mile `mi` | ||
Metre `m` | Foot `ft or '` | ||
Centimetre `cm` | Inch `in or "` | ||
|
||
### Area | ||
Metric | Imperial | ||
------ | -------- | ||
Hectare `ha` | Acre `acre` | ||
|
||
### Speed | ||
Metric | Imperial | ||
------ | -------- | ||
Kilometre per hour `kph or km/h` | Mile per hour `mph or mi/h` | ||
|
||
### Mass | ||
Metric | Imperial | ||
------ | -------- | ||
Gram `g` | Ounce `oz` | ||
Kilogram `kg` | Pound `lb or lbs` | ||
|
||
### Volume | ||
Metric | Imperial | ||
------ | -------- | ||
Litre `L` | Gallon (US) `gal` | ||
Millilitre `ml` | Cup `cup` | ||
|
||
### Pressure | ||
Metric | Imperial | ||
------ | -------- | ||
Pascal `pascal` | Pound\[-force] per square inch `psi` | ||
|
||
### Temperature | ||
Metric | Imperial | ||
------ | -------- | ||
Celsius `C or degC or °C` | Fahrenheit `F or degF or °F` | ||
|
||
### Energy | ||
Metric | Imperial | ||
------ | -------- | ||
Joule `J` | Foot pound `ft_lb or foot_pound` | ||
|
||
### Angle | ||
Radian | Degree | ||
------ | -------- | ||
Radian `rad` | Degree `deg` | ||
|
||
|
||
|
||
## One-way | ||
|
||
Only the units on the left will map to the unit on the right. | ||
|
||
### Length | ||
From | To | ||
---- | --- | ||
Yard `yd` | Metre `m` | ||
|
||
### Speed | ||
From | To | ||
---- | --- | ||
Metre per second `mps or m/s` | Kilometre per hour `kph or km/h` | ||
Foot per second `ft/s` | Mile per hour `mph or mi/h` | ||
|
||
### Mass | ||
From | To | ||
---- | --- | ||
Stone `stone` | Kilogram `kg` | ||
|
||
### Volume | ||
From | To | ||
---- | --- | ||
Pint `pint` | Litre `L` | ||
Fluid ounce `floz` | Millilitre `ml` | ||
|
||
### Pressure | ||
From | To | ||
---- | --- | ||
Atmosphere `atm` | Pound\[-force] per square inch `psi` | ||
Bar `bar` | Pound\[-force] force per square inch `psi` | ||
|
||
### Temperature | ||
From | To | ||
---- | --- | ||
Kelvin `K` | Celsius `C or degC or °C` | ||
|
||
### Time | ||
From | To | ||
---- | --- | ||
Second `s or sec` | Minute `min` | ||
Minute `min` | Hour `h or hr` | ||
Hour `h or hr` | Day `day` | ||
Day `day` | Week `week` |