Useful debug info
This commit is contained in:
parent
b2082c89a4
commit
4f3b6c2aa9
38
Cargo.lock
generated
38
Cargo.lock
generated
@ -1,6 +1,6 @@
|
|||||||
# This file is automatically @generated by Cargo.
|
# This file is automatically @generated by Cargo.
|
||||||
# It is not intended for manual editing.
|
# It is not intended for manual editing.
|
||||||
version = 3
|
version = 4
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "addr2line"
|
name = "addr2line"
|
||||||
@ -109,6 +109,19 @@ dependencies = [
|
|||||||
"generic-array",
|
"generic-array",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "build-time"
|
||||||
|
version = "0.1.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f1219c19fc29b7bfd74b7968b420aff5bc951cf517800176e795d6b2300dd382"
|
||||||
|
dependencies = [
|
||||||
|
"chrono",
|
||||||
|
"once_cell",
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn 2.0.59",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bumpalo"
|
name = "bumpalo"
|
||||||
version = "3.16.0"
|
version = "3.16.0"
|
||||||
@ -1245,6 +1258,25 @@ version = "0.1.23"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76"
|
checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rustc_version"
|
||||||
|
version = "0.4.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92"
|
||||||
|
dependencies = [
|
||||||
|
"semver",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rustc_version_runtime"
|
||||||
|
version = "0.3.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2dd18cd2bae1820af0b6ad5e54f4a51d0f3fcc53b05f845675074efcc7af071d"
|
||||||
|
dependencies = [
|
||||||
|
"rustc_version",
|
||||||
|
"semver",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustix"
|
name = "rustix"
|
||||||
version = "0.38.32"
|
version = "0.38.32"
|
||||||
@ -1490,14 +1522,16 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "shibe-bot"
|
name = "shibe-bot"
|
||||||
version = "0.2.1"
|
version = "0.2.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"build-time",
|
||||||
"dotenv",
|
"dotenv",
|
||||||
"log",
|
"log",
|
||||||
"poise",
|
"poise",
|
||||||
"pretty_env_logger",
|
"pretty_env_logger",
|
||||||
"rand",
|
"rand",
|
||||||
"roux",
|
"roux",
|
||||||
|
"rustc_version_runtime",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"tokio",
|
"tokio",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "shibe-bot"
|
name = "shibe-bot"
|
||||||
version = "0.2.1"
|
version = "0.2.2"
|
||||||
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
|
||||||
@ -15,3 +15,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.12"
|
||||||
|
rustc_version_runtime = "0.3.0"
|
||||||
|
build-time = "0.1.3"
|
||||||
|
12
README.md
12
README.md
@ -1,3 +1,9 @@
|
|||||||
# shibe-bot
|
# shibe-bot 0.2.2
|
||||||
|
## About Shibe Bot
|
||||||
A discord bot using Rust and Poise. Does nothing useful right now. All code is licensed under the MIT license, see LICENSE.txt for details.
|
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
|
||||||
|
Shibe Bot is available under the MIT license. See [LICENSE.txt](LICENSE.txt) for details.
|
||||||
|
## Environment
|
||||||
|
The environment variable `TOKEN` must be set to the application's authentication token for the bot to run properly.
|
||||||
|
## Contributing
|
||||||
|
Feel free to make PRs or feature requests. See [TODO.md](TODO.md) for future features.
|
@ -4,6 +4,8 @@ use rand::Rng;
|
|||||||
use crate::Context;
|
use crate::Context;
|
||||||
use crate::Error;
|
use crate::Error;
|
||||||
|
|
||||||
|
use build_time::build_time_local;
|
||||||
|
|
||||||
const INVITE_LINK: &str = "https://discord.com/oauth2/authorize?client_id=1030701552941412382&permissions=116736&response_type=code&redirect_uri=https%3A%2F%2Fdiscordapp.com%2Foauth2%2Fauthorize%3F%26client_id%3D1030701552941412382%26scope%3Dbot&scope=guilds+bot";
|
const INVITE_LINK: &str = "https://discord.com/oauth2/authorize?client_id=1030701552941412382&permissions=116736&response_type=code&redirect_uri=https%3A%2F%2Fdiscordapp.com%2Foauth2%2Fauthorize%3F%26client_id%3D1030701552941412382%26scope%3Dbot&scope=guilds+bot";
|
||||||
|
|
||||||
/// Add this bot to your server
|
/// Add this bot to your server
|
||||||
@ -38,12 +40,17 @@ pub async fn age(
|
|||||||
#[poise::command(slash_command, global_cooldown = 30)]
|
#[poise::command(slash_command, global_cooldown = 30)]
|
||||||
pub async fn info(ctx: Context<'_>) -> Result<(), Error> {
|
pub async fn info(ctx: Context<'_>) -> Result<(), Error> {
|
||||||
ctx.say(format!(
|
ctx.say(format!(
|
||||||
"Shibe Bot v{} was created by Shibe Drill (@shibedrill) using Rust and \
|
"Shibe Bot v{} was created by Shibe Drill (@shibedrill) \
|
||||||
Poise.\nWebsite: <https://riverdev.carrd.co>\n\
|
using Rust and Poise.\n\
|
||||||
|
rustc version: {}\n\
|
||||||
|
Build timestamp: {}\n\
|
||||||
|
Website: <https://riverdev.carrd.co>\n\
|
||||||
Source code: <https://github.com/shibedrill/shibe-bot>\n\
|
Source code: <https://github.com/shibedrill/shibe-bot>\n\
|
||||||
Poise: <https://docs.rs/poise/latest/poise/>\n\
|
Poise: <https://docs.rs/poise/latest/poise/>\n\
|
||||||
Rust: <https://www.rust-lang.org/>",
|
Rust: <https://www.rust-lang.org/>",
|
||||||
env!("CARGO_PKG_VERSION")
|
env!("CARGO_PKG_VERSION"),
|
||||||
|
rustc_version_runtime::version(),
|
||||||
|
build_time_local!()
|
||||||
))
|
))
|
||||||
.await?;
|
.await?;
|
||||||
info!("Executed command `info` successfully");
|
info!("Executed command `info` successfully");
|
||||||
|
@ -58,11 +58,10 @@ async fn event_handler(
|
|||||||
_framework: poise::FrameworkContext<'_, Data, Error>,
|
_framework: poise::FrameworkContext<'_, Data, Error>,
|
||||||
data: &Data,
|
data: &Data,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
match event {
|
if let FullEvent::ChannelDelete {
|
||||||
FullEvent::ChannelDelete {
|
|
||||||
channel,
|
channel,
|
||||||
messages: _,
|
messages: _,
|
||||||
} => {
|
} = event {
|
||||||
info!("Handling event type: ChannelDelete({})", channel.id);
|
info!("Handling event type: ChannelDelete({})", channel.id);
|
||||||
data.config_manager
|
data.config_manager
|
||||||
.lock()
|
.lock()
|
||||||
@ -70,8 +69,6 @@ async fn event_handler(
|
|||||||
.channels
|
.channels
|
||||||
.retain(|item| *item != u64::from(channel.id));
|
.retain(|item| *item != u64::from(channel.id));
|
||||||
}
|
}
|
||||||
_ => (),
|
|
||||||
}
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user