Update serenity to v0.8 (#7)

This commit is contained in:
natsukagami 2020-01-16 06:49:27 +00:00 committed by Gitea
parent ebb381ad4e
commit a17e9c6d1d
9 changed files with 412 additions and 672 deletions

1037
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -7,4 +7,4 @@ edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
serenity = "0.7"
serenity = "0.8"

View file

@ -7,13 +7,13 @@ edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
serenity = "0.7"
serenity = "0.8"
dotenv = "0.15"
serde = { version = "1.0", features = ["derive"] }
chrono = "0.4.9"
rand = "0.7.2"
static_assertions = "1.1.0"
reqwest = "0.9.24"
reqwest = "0.10.1"
[dependencies.rustbreak]
version = "2.0.0-rc3"

View file

@ -15,13 +15,10 @@ use std::{thread::sleep, time::Duration};
mod soft_ban;
pub use soft_ban::watch_soft_bans;
group!({
name: "admin",
options: {
description: "Administrative commands for the server.",
},
commands: [clean, ban, kick, soft_ban, soft_ban_init],
});
#[group]
#[description = "Administrative commands for the server."]
#[commands(clean, ban, kick, soft_ban, soft_ban_init)]
struct Admin;
#[command]
#[aliases("cleanall")]

View file

@ -19,14 +19,11 @@ mod votes;
use votes::VOTE_COMMAND;
group!({
name: "community",
options: {
only_in: "guilds",
description: "Community related commands. Usually comes with some sort of delays, since it involves pinging",
},
commands: [choose, vote],
});
#[group]
#[description = "Community related commands. Usually comes with some sort of delays, since it involves pinging"]
#[only_in("guilds")]
#[commands(choose, vote)]
struct Community;
#[command]
#[description = r"👑 Randomly choose an active member and mention them!

View file

@ -1,5 +1,5 @@
use crate::http::HTTP;
use reqwest::Client as HTTPClient;
use reqwest::blocking::Client as HTTPClient;
use serde::Deserialize;
use serenity::framework::standard::CommandError as Error;
use serenity::prelude::*;

View file

@ -17,13 +17,10 @@ mod names;
use images::*;
group!({
name: "fun",
options: {
description: "Random commands",
},
commands: [roll, pick, name, image, nsfw],
});
#[group]
#[description = "Random commands"]
#[commands(roll, pick, name, image, nsfw)]
struct Fun;
#[command]
#[description = "🎲 Rolls a dice that gives you a random number."]

View file

@ -3,5 +3,5 @@ use serenity::prelude::TypeMapKey;
pub(crate) struct HTTP;
impl TypeMapKey for HTTP {
type Value = reqwest::Client;
type Value = reqwest::blocking::Client;
}

View file

@ -38,7 +38,7 @@ fn main() {
// Setup shared instances of things
{
let mut data = client.data.write();
data.insert::<http::HTTP>(reqwest::Client::new());
data.insert::<http::HTTP>(reqwest::blocking::Client::new());
}
// Create handler threads