fmt: clippy and nightly fmt
This commit is contained in:
parent
57d4947edf
commit
9d409e3692
20 changed files with 194 additions and 143 deletions
|
@ -1,12 +1,17 @@
|
|||
use crate::Config;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serenity::model::guild;
|
||||
use serenity::model::id::{ChannelId, GuildId, RoleId, UserId};
|
||||
use serenity::prelude::TypeMapKey;
|
||||
use sqlx::sqlite::{SqliteConnectOptions, SqlitePoolOptions, SqliteRow};
|
||||
use sqlx::{Error, FromRow, Pool, Row, Sqlite};
|
||||
use std::str::FromStr;
|
||||
use std::sync::Arc;
|
||||
use serenity::{
|
||||
model::{
|
||||
guild,
|
||||
id::{ChannelId, GuildId, RoleId, UserId},
|
||||
},
|
||||
prelude::TypeMapKey,
|
||||
};
|
||||
use sqlx::{
|
||||
sqlite::{SqliteConnectOptions, SqlitePoolOptions, SqliteRow},
|
||||
Error, FromRow, Pool, Row, Sqlite,
|
||||
};
|
||||
use std::{str::FromStr, sync::Arc};
|
||||
use tokio::sync::RwLock;
|
||||
|
||||
pub struct DataBase;
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
use crate::common::set_roles::normal::get_server_member_bulk;
|
||||
use crate::Config;
|
||||
use serde::de::DeserializeOwned;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use crate::{common::set_roles::normal::get_server_member_bulk, Config};
|
||||
use serde::{de::DeserializeOwned, Deserialize, Serialize};
|
||||
use serenity::model::id::GuildId;
|
||||
use sqlx::sqlite::SqliteRow;
|
||||
use sqlx::{Error, FromRow, Pool, Row, Sqlite};
|
||||
use sqlx::{sqlite::SqliteRow, Error, FromRow, Pool, Row, Sqlite};
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize)]
|
||||
pub struct Minecraft {
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
// this code is taken from https://github.com/MCorange99/svg2colored-png/tree/main
|
||||
// I was unable to figure out how to use usvg myself so younked it from here.
|
||||
|
||||
use std::ffi::OsStr;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::{
|
||||
ffi::OsStr,
|
||||
path::{Path, PathBuf},
|
||||
};
|
||||
|
||||
// use clap::builder::OsStr;
|
||||
use color_eyre::{eyre::bail, Result};
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
pub mod normal {
|
||||
use crate::common::database::{DataBase, ServerMembersWolves, Servers, Wolves};
|
||||
use crate::get_now_iso;
|
||||
use serenity::client::Context;
|
||||
use serenity::model::id::{GuildId, RoleId, UserId};
|
||||
use crate::{
|
||||
common::database::{DataBase, ServerMembersWolves, Servers, Wolves},
|
||||
get_now_iso,
|
||||
};
|
||||
use serenity::{
|
||||
client::Context,
|
||||
model::id::{GuildId, RoleId, UserId},
|
||||
};
|
||||
use sqlx::{Pool, Sqlite};
|
||||
|
||||
struct RolesChange {
|
||||
|
@ -152,21 +156,22 @@ pub mod normal {
|
|||
|
||||
// for updating committee members
|
||||
pub mod committee {
|
||||
use crate::common::database::{get_channel_from_row, get_role_from_row, DataBase, Wolves};
|
||||
use crate::common::wolves::committees::Committees;
|
||||
use crate::Config;
|
||||
use crate::{
|
||||
common::{
|
||||
database::{get_channel_from_row, get_role_from_row, DataBase, Wolves},
|
||||
wolves::committees::Committees,
|
||||
},
|
||||
Config,
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serenity::all::EditRole;
|
||||
use serenity::builder::CreateChannel;
|
||||
use serenity::client::Context;
|
||||
use serenity::model::channel::ChannelType;
|
||||
use serenity::model::guild::Member;
|
||||
use serenity::model::id::ChannelId;
|
||||
use serenity::model::prelude::RoleId;
|
||||
use sqlx::sqlite::SqliteRow;
|
||||
use sqlx::{Error, FromRow, Pool, Row, Sqlite};
|
||||
use serenity::{
|
||||
all::EditRole,
|
||||
builder::CreateChannel,
|
||||
client::Context,
|
||||
model::{channel::ChannelType, guild::Member, id::ChannelId, prelude::RoleId},
|
||||
};
|
||||
use sqlx::{sqlite::SqliteRow, Error, FromRow, Pool, Row, Sqlite};
|
||||
use std::collections::HashMap;
|
||||
use std::sync::Arc;
|
||||
|
||||
pub async fn check_committee(ctx: &Context) {
|
||||
let db_lock = {
|
||||
|
@ -187,7 +192,7 @@ pub mod committee {
|
|||
// because to use it to update a single user we need to pre-get the members of teh server
|
||||
let mut members = server.members(&ctx, None, None).await.unwrap_or_default();
|
||||
|
||||
update_committees(&db, &ctx, &config_global, &mut members).await;
|
||||
update_committees(&db, ctx, &config_global, &mut members).await;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -342,11 +347,11 @@ pub mod committee {
|
|||
for role in &roles_current {
|
||||
roles_current_id.push(role.id.to_owned());
|
||||
if !roles_required.contains(&role.id) {
|
||||
if role.id == committee_member {
|
||||
if !on_committee {
|
||||
roles_rem.push(role.id.to_owned());
|
||||
}
|
||||
if role.id == committee_member && on_committee {
|
||||
continue;
|
||||
}
|
||||
|
||||
roles_rem.push(role.id.to_owned());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -48,11 +48,14 @@ async fn add_users_wolves(db: &Pool<Sqlite>, user: &WolvesResultUserMin) {
|
|||
This is getting data for Clubs and Socs
|
||||
*/
|
||||
pub mod cns {
|
||||
use crate::common::database::{get_server_config_bulk, DataBase, ServerMembers, ServerMembersWolves, Servers};
|
||||
use crate::common::wolves::{add_users_wolves, WolvesResultUserMin};
|
||||
use crate::Config;
|
||||
use serenity::client::Context;
|
||||
use serenity::model::id::GuildId;
|
||||
use crate::{
|
||||
common::{
|
||||
database::{get_server_config_bulk, DataBase, ServerMembers, ServerMembersWolves, Servers},
|
||||
wolves::{add_users_wolves, WolvesResultUserMin},
|
||||
},
|
||||
Config,
|
||||
};
|
||||
use serenity::{client::Context, model::id::GuildId};
|
||||
use sqlx::{Pool, Sqlite};
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
|
@ -191,8 +194,7 @@ pub mod cns {
|
|||
Get and store the data on C&S committees
|
||||
*/
|
||||
pub mod committees {
|
||||
use crate::common::database::DataBase;
|
||||
use crate::Config;
|
||||
use crate::{common::database::DataBase, Config};
|
||||
use serenity::client::Context;
|
||||
use sqlx::{Pool, Sqlite};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue