mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-04-18 16:28:55 +00:00
Update serenity to v0.8 (#7)
This commit is contained in:
parent
ebb381ad4e
commit
a17e9c6d1d
9 changed files with 412 additions and 672 deletions
1037
Cargo.lock
generated
1037
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -7,4 +7,4 @@ edition = "2018"
|
||||||
# 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
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
serenity = "0.7"
|
serenity = "0.8"
|
||||||
|
|
|
@ -7,13 +7,13 @@ edition = "2018"
|
||||||
# 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
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
serenity = "0.7"
|
serenity = "0.8"
|
||||||
dotenv = "0.15"
|
dotenv = "0.15"
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
chrono = "0.4.9"
|
chrono = "0.4.9"
|
||||||
rand = "0.7.2"
|
rand = "0.7.2"
|
||||||
static_assertions = "1.1.0"
|
static_assertions = "1.1.0"
|
||||||
reqwest = "0.9.24"
|
reqwest = "0.10.1"
|
||||||
|
|
||||||
[dependencies.rustbreak]
|
[dependencies.rustbreak]
|
||||||
version = "2.0.0-rc3"
|
version = "2.0.0-rc3"
|
||||||
|
|
|
@ -15,13 +15,10 @@ use std::{thread::sleep, time::Duration};
|
||||||
mod soft_ban;
|
mod soft_ban;
|
||||||
pub use soft_ban::watch_soft_bans;
|
pub use soft_ban::watch_soft_bans;
|
||||||
|
|
||||||
group!({
|
#[group]
|
||||||
name: "admin",
|
#[description = "Administrative commands for the server."]
|
||||||
options: {
|
#[commands(clean, ban, kick, soft_ban, soft_ban_init)]
|
||||||
description: "Administrative commands for the server.",
|
struct Admin;
|
||||||
},
|
|
||||||
commands: [clean, ban, kick, soft_ban, soft_ban_init],
|
|
||||||
});
|
|
||||||
|
|
||||||
#[command]
|
#[command]
|
||||||
#[aliases("cleanall")]
|
#[aliases("cleanall")]
|
||||||
|
|
|
@ -19,14 +19,11 @@ mod votes;
|
||||||
|
|
||||||
use votes::VOTE_COMMAND;
|
use votes::VOTE_COMMAND;
|
||||||
|
|
||||||
group!({
|
#[group]
|
||||||
name: "community",
|
#[description = "Community related commands. Usually comes with some sort of delays, since it involves pinging"]
|
||||||
options: {
|
#[only_in("guilds")]
|
||||||
only_in: "guilds",
|
#[commands(choose, vote)]
|
||||||
description: "Community related commands. Usually comes with some sort of delays, since it involves pinging",
|
struct Community;
|
||||||
},
|
|
||||||
commands: [choose, vote],
|
|
||||||
});
|
|
||||||
|
|
||||||
#[command]
|
#[command]
|
||||||
#[description = r"👑 Randomly choose an active member and mention them!
|
#[description = r"👑 Randomly choose an active member and mention them!
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use crate::http::HTTP;
|
use crate::http::HTTP;
|
||||||
use reqwest::Client as HTTPClient;
|
use reqwest::blocking::Client as HTTPClient;
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
use serenity::framework::standard::CommandError as Error;
|
use serenity::framework::standard::CommandError as Error;
|
||||||
use serenity::prelude::*;
|
use serenity::prelude::*;
|
||||||
|
|
|
@ -17,13 +17,10 @@ mod names;
|
||||||
|
|
||||||
use images::*;
|
use images::*;
|
||||||
|
|
||||||
group!({
|
#[group]
|
||||||
name: "fun",
|
#[description = "Random commands"]
|
||||||
options: {
|
#[commands(roll, pick, name, image, nsfw)]
|
||||||
description: "Random commands",
|
struct Fun;
|
||||||
},
|
|
||||||
commands: [roll, pick, name, image, nsfw],
|
|
||||||
});
|
|
||||||
|
|
||||||
#[command]
|
#[command]
|
||||||
#[description = "🎲 Rolls a dice that gives you a random number."]
|
#[description = "🎲 Rolls a dice that gives you a random number."]
|
||||||
|
|
|
@ -3,5 +3,5 @@ use serenity::prelude::TypeMapKey;
|
||||||
pub(crate) struct HTTP;
|
pub(crate) struct HTTP;
|
||||||
|
|
||||||
impl TypeMapKey for HTTP {
|
impl TypeMapKey for HTTP {
|
||||||
type Value = reqwest::Client;
|
type Value = reqwest::blocking::Client;
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ fn main() {
|
||||||
// Setup shared instances of things
|
// Setup shared instances of things
|
||||||
{
|
{
|
||||||
let mut data = client.data.write();
|
let mut data = client.data.write();
|
||||||
data.insert::<http::HTTP>(reqwest::Client::new());
|
data.insert::<http::HTTP>(reqwest::blocking::Client::new());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create handler threads
|
// Create handler threads
|
||||||
|
|
Loading…
Add table
Reference in a new issue