Skip to content

Commit

Permalink
chore: update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
imatpot committed Aug 31, 2024
1 parent 57cca8e commit 26cc893
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 60 deletions.
File renamed without changes.
107 changes: 49 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@

<p align="center">
<i>
Discord bot for managing <a href="https://warframe.fandom.com/wiki/Lunaro">Lunaro</a>
related ideas, targeted at the <a href="https://discord.gg/mUjGHEw">Lunaro Revival Discord Server</a>
Discord bot for managing everything <a href="https://warframe.fandom.com/wiki/Lunaro">Lunaro</a> for the <a href="https://discord.gg/rFBzmpEQxc">Academia Lunaris Discord Server</a>
</i>
</p>

Expand All @@ -18,113 +17,111 @@
<a href="LICENSE.md" style="text-decoration: none">
<img src="https://img.shields.io/github/license/imatpot/lunaro-manager?color=blue&style=flat-square">
</a>
<a href="https://discord.gg/rFBzmpEQxc" style="text-decoration: none">
<img src="https://img.shields.io/badge/Join-Academia%20Lunaris-%237289da?logo=discord&style=flat-square">
</a>
</p>

---

## Invite

This bot is readily available in the [Lunaro Revival Discord Server](https://discord.gg/mUjGHEw).

<a href="https://discord.gg/mUjGHEw" style="text-decoration: none">
<img src="https://img.shields.io/badge/Join-Lunaro%20Revival%20Server-%237289da?logo=discord&style=flat-square">
</a>

<br />

In case you want to add this bot to a different server, use the following link:

https://discord.com/api/oauth2/authorize?permissions=277293894656&scope=bot%20applications.commands&client_id=123

while inserting your client ID and keeping the scopes. Remember that the bot is
designed to *only be active in 1 server at a time.*

Please also make sure the bot's personal role is ranked *above* the managed playing role!

---

## Usage

This section explains all functionality which Lunaro Manager offers. Every
action will be replied to with a (selectively ephemeral) message.
> [!NOTE]
> Lunaro tracking is **enabled** for every server member by default.
>
> Lunaro Manager will react to changes in your Discord rich presence.
> It will automatically set your playing status to "Playing Lunaro" when you are playing Lunaro, and remove it with a small delay when you are not.
>
> You can disable Lunaro tracking for your account at any time using the [`/tracking pause`](#-tracking-pause) command.
### `❓ /help`

Guides to the Discord command explorer to discover all commands, and also links
to this GitHub section.
Guides to the Discord command explorer to discover all commands, and also links to this GitHub section.

### `🏓 /ping`

Check if Lunaro Manager is online and how long it took to receive the ping. This
value is calculated from the system time, and may thus be inaccurate.
Check if Lunaro Manager is online and how long it took to receive the ping.
This value is calculated from the system time, and may thus be inaccurate.

### `🟢 /play now`

Adds the configured playing role to your profile.
Adds the playing role to your profile.
You can optionally disable Lunaro tracking for your account at the same time.

### `⭕ /play later`

Removes the configured playing role from your profile.
Removes the playing role from your profile.
You can optionally re-enable Lunaro tracking for your account at the same time.

### `👀 /play info`

Lists the number of members with the playing role.
Lists the number of members playing Lunaro.

### `💤 /tracking pause`

Disables Lunaro tracking for your account. This is useful because the Lunaro
tracker will otherwise override your manually set playing status.
Disables Lunaro tracking for your account.

The bot will no longer react to changes in your Discord rich presence.
This is useful because the Lunaro tracker will otherwise override your manually set playing status.

### `👁️ /tracking resume`

Enables Lunaro tracking for your account. Now you don't have to manually set
your playing status anymore.
Enables Lunaro tracking for your account.

The bot will now react to changes in your Discord rich presence.
Now you don't have to manually set your playing status anymore, as the bot will automatically check if you are playing Lunaro.

### `💡 /about`

Displays details about Lunaro Manager, including amount of actively tracked
members as well as stats and metadata about the bot.
Displays details about Lunaro Manager, including amount of actively tracked members as well as stats and metadata about the bot.

### `🤝 /contribute`

Displays a link to this GitHub page, encouraging the creation of issues and
pull requests.

---
Displays a link to this GitHub page, encouraging the creation of issues and pull requests.

## Setup
## Development setup

1. Create a bot on https://discord.com/developers

2. Enable `PRESENCE` & `SERVER MEMBERS` intents in the Bot section

3. Create a `.env` file following the example of [.env.example](.env.example)
3. Invite the bot to your server, giving the following permissions:
- Manage Roles
- Send Messages

4. Run the bot (see next sections)
4. Create a `.env` file following the schema in [.env.schema](.env.schema)

5. Run the bot using one of the methods below

## Running the bot

You can run the bot in several ways, depending on your preference and use case.

### Run locally

You need to have [Rust](https://rust-lang.org) installed.
This is the recommended way to run the bot during development.

```sh
$ cargo run
```

### Run in Docker

You need to have [Docker](https://docker.com) installed.
This is the recommended way to run the bot in production.

```sh
$ docker compose up --build -d
```

### Run using Nix

If you have the [Nix](https://nixos.org) package manager installed, and enabled
[Flakes](https://nixos.wiki/wiki/Flakes), you have several ways to build and run
this bot.
If you have the [Nix](https://nixos.org) package manager installed with [Flakes](https://nixos.wiki/wiki/Flakes) enabled, you have several ways to build and run this bot.

As a reminder:

- `nix build` builds the package binary
- `nix shell` builds the package binary and makes it available in your `$PATH`
- `nix run` builds the package binary and immediately executes it
- `nix shell` builds the package binary and makes it available in your shell

I will use `nix run` as the example, but you can use any of the above.

Expand All @@ -136,11 +133,5 @@ $ nix run
$ nix run github:imatpot/lunaro-manager

# run specific version using remote repository
$ nix run github:imatpot/lunaro-manager/2.0.0
```

### Run in Docker

```sh
$ docker-compose up --build -d
$ nix run github:imatpot/lunaro-manager/2.1.0
```
4 changes: 2 additions & 2 deletions src/commands/tracking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub async fn run(_context: PoiseContext<'_>) -> Result<(), Error> {
Ok(())
}

/// 💤 Pause Lunaro tracking on your account
/// 💤 Pause Lunaro tracking for your account
#[command(slash_command)]
async fn pause(context: PoiseContext<'_>) -> Result<(), Error> {
let member = context.author();
Expand All @@ -30,7 +30,7 @@ async fn pause(context: PoiseContext<'_>) -> Result<(), Error> {
Ok(())
}

/// 👁️ Resume Lunaro tracking on your account
/// 👁️ Resume Lunaro tracking for your account
#[command(slash_command)]
async fn resume(context: PoiseContext<'_>) -> Result<(), Error> {
let member = context.author();
Expand Down

0 comments on commit 26cc893

Please sign in to comment.