mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-16 02:30:11 +00:00
feat(stats): query http gateway, wait until gateway up to collect discord stats
This commit is contained in:
parent
e4ed354536
commit
9ff824c37b
7 changed files with 130 additions and 17 deletions
|
|
@ -1,6 +1,7 @@
|
|||
use anyhow::format_err;
|
||||
use lazy_static::lazy_static;
|
||||
use std::sync::Arc;
|
||||
use tokio::sync::RwLock;
|
||||
use twilight_cache_inmemory::{
|
||||
model::CachedMember,
|
||||
permission::{MemberRoles, RootError},
|
||||
|
|
@ -110,10 +111,14 @@ pub fn new() -> DiscordCache {
|
|||
.build(),
|
||||
);
|
||||
|
||||
DiscordCache(cache, client)
|
||||
DiscordCache(cache, client, RwLock::new(Vec::new()))
|
||||
}
|
||||
|
||||
pub struct DiscordCache(pub Arc<InMemoryCache>, pub Arc<twilight_http::Client>);
|
||||
pub struct DiscordCache(
|
||||
pub Arc<InMemoryCache>,
|
||||
pub Arc<twilight_http::Client>,
|
||||
pub RwLock<Vec<u32>>,
|
||||
);
|
||||
|
||||
impl DiscordCache {
|
||||
pub async fn guild_permissions(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue