Improved error handling again, add dependabot
This commit is contained in:
parent
30232c529e
commit
8a6f4b48a7
6
.github/dependabot.yml
vendored
Normal file
6
.github/dependabot.yml
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: "cargo"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
2
.github/workflows/rust.yml
vendored
2
.github/workflows/rust.yml
vendored
@ -27,6 +27,8 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
- name: Check
|
||||||
|
run: cargo check
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cargo build
|
run: cargo build
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
|
6
Cargo.lock
generated
6
Cargo.lock
generated
@ -1242,9 +1242,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "roux"
|
name = "roux"
|
||||||
version = "2.2.12"
|
version = "2.2.13"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "15948b57a15aed182d06fe3810eaf27dda15583c2f714437e1dd88fa12f33b82"
|
checksum = "0d306132b82946facd60ecf5505a2d6a8c69dd4b96b493bb16ff637987569028"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"maybe-async",
|
"maybe-async",
|
||||||
"reqwest",
|
"reqwest",
|
||||||
@ -1522,7 +1522,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "shibe-bot"
|
name = "shibe-bot"
|
||||||
version = "0.2.4"
|
version = "0.2.5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"build-time",
|
"build-time",
|
||||||
"dotenv",
|
"dotenv",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "shibe-bot"
|
name = "shibe-bot"
|
||||||
version = "0.2.4"
|
version = "0.2.5"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
@ -14,6 +14,6 @@ tokio = { version = "1.0", features = ["macros", "rt-multi-thread"] }
|
|||||||
rand = "0.8.5"
|
rand = "0.8.5"
|
||||||
serde = { version = "1.0.198", features = ["serde_derive"] }
|
serde = { version = "1.0.198", features = ["serde_derive"] }
|
||||||
serde_json = "1.0.116"
|
serde_json = "1.0.116"
|
||||||
roux = "2.2.12"
|
roux = "2.2.13"
|
||||||
rustc_version_runtime = "0.3.0"
|
rustc_version_runtime = "0.3.0"
|
||||||
build-time = "0.1.3"
|
build-time = "0.1.3"
|
||||||
|
11
README.md
11
README.md
@ -1,11 +1,20 @@
|
|||||||
# Shibe Bot 0.2.4
|
# Shibe Bot 0.2.5
|
||||||
|
|
||||||
[](https://github.com/shibedrill/shibe-bot/actions/workflows/rust.yml)
|
[](https://github.com/shibedrill/shibe-bot/actions/workflows/rust.yml)
|
||||||
[](LICENSE.txt)
|
[](LICENSE.txt)
|
||||||
|
|
||||||
## About Shibe Bot
|
## About Shibe Bot
|
||||||
|
|
||||||
Shibe Bot is a Discord bot written in Rust, using the Poise framework and the Serenity API crate. It has a few command groups right now, but none do anything especially useful. Commands are located at [src/command/](src/command/).
|
Shibe Bot is a Discord bot written in Rust, using the Poise framework and the Serenity API crate. It has a few command groups right now, but none do anything especially useful. Commands are located at [src/command/](src/command/).
|
||||||
|
|
||||||
## Licensing
|
## Licensing
|
||||||
|
|
||||||
Shibe Bot is available under the MIT license. See [LICENSE.txt](LICENSE.txt) for details.
|
Shibe Bot is available under the MIT license. See [LICENSE.txt](LICENSE.txt) for details.
|
||||||
|
|
||||||
## Environment
|
## Environment
|
||||||
|
|
||||||
The environment variable `TOKEN` must be set to the application's authentication token for the bot to run properly.
|
The environment variable `TOKEN` must be set to the application's authentication token for the bot to run properly.
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
Feel free to make PRs or feature requests. See [TODO.md](TODO.md) for future features.
|
Feel free to make PRs or feature requests. See [TODO.md](TODO.md) for future features.
|
||||||
|
@ -35,7 +35,12 @@ pub async fn meow(ctx: Context<'_>) -> Result<(), Error> {
|
|||||||
true => "woof",
|
true => "woof",
|
||||||
// Will never return None. The source is statically defined.
|
// Will never return None. The source is statically defined.
|
||||||
// We know it will always have items in it.
|
// We know it will always have items in it.
|
||||||
false => meows.choose(&mut rng).ok_or("`meows` array is empty")?,
|
false => meows
|
||||||
|
.choose(&mut rng)
|
||||||
|
.ok_or("`meows` array is empty")
|
||||||
|
.inspect_err(|e| {
|
||||||
|
error!("Executing command `meow` failed: {}", e);
|
||||||
|
})?
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
ctx.say(response).await?;
|
ctx.say(response).await?;
|
||||||
|
Loading…
Reference in New Issue
Block a user