feat: fixed up the changes
This commit is contained in:
parent
c79113921d
commit
cab04a068f
11 changed files with 62 additions and 47 deletions
12
src/lib.rs
12
src/lib.rs
|
@ -1,12 +1,19 @@
|
|||
pub mod common;
|
||||
|
||||
use crate::common::set_roles::normal::get_server_member_bulk;
|
||||
use chrono::{Datelike, SecondsFormat, Utc};
|
||||
use dotenvy::dotenv;
|
||||
use rand::{distributions::Alphanumeric, thread_rng, Rng};
|
||||
use serde::de::DeserializeOwned;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serenity::client::Context;
|
||||
use serenity::model::id::{ChannelId, GuildId, RoleId};
|
||||
use serenity::model::guild;
|
||||
use serenity::model::id::{ChannelId, GuildId, RoleId, UserId};
|
||||
use serenity::model::prelude::application_command::ApplicationCommandInteraction;
|
||||
use serenity::prelude::TypeMapKey;
|
||||
use sqlx::sqlite::{SqliteConnectOptions, SqlitePoolOptions, SqliteRow};
|
||||
use sqlx::{Error, FromRow, Pool, Row, Sqlite};
|
||||
use std::str::FromStr;
|
||||
use std::{env, sync::Arc};
|
||||
use tokio::sync::RwLock;
|
||||
|
||||
|
@ -56,6 +63,7 @@ pub fn get_config() -> Config {
|
|||
mail_user: "".to_string(),
|
||||
mail_pass: "".to_string(),
|
||||
wolves_url: "".to_string(),
|
||||
wolves_api: "".to_string(),
|
||||
committee_server: GuildId(0),
|
||||
committee_role: RoleId(0),
|
||||
committee_category: ChannelId(0),
|
||||
|
@ -418,6 +426,7 @@ pub fn random_string(len: usize) -> String {
|
|||
|
||||
pub mod set_roles {
|
||||
use super::*;
|
||||
use crate::common::database::DataBase;
|
||||
pub async fn update_server(ctx: &Context, server: &Servers, remove_roles: &[Option<RoleId>], members_changed: &[UserId]) {
|
||||
let db_lock = {
|
||||
let data_read = ctx.data.read().await;
|
||||
|
@ -544,6 +553,7 @@ pub mod set_roles {
|
|||
|
||||
pub mod get_data {
|
||||
use super::*;
|
||||
use crate::common::database::DataBase;
|
||||
use crate::set_roles::update_server;
|
||||
use std::collections::BTreeMap;
|
||||
use wolves_oxidised::WolvesUser;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue