mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-02 21:16:09 +00:00
feat: client.latency
This commit is contained in:
parent
5fe109527d
commit
329c8e297c
@ -54,8 +54,16 @@ export class Client<Ready extends boolean = boolean> extends BaseClient {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get latency() {
|
||||||
|
let acc = 0;
|
||||||
|
|
||||||
|
this.gateway.forEach(s => (acc += s.latency));
|
||||||
|
|
||||||
|
return acc / this.gateway.size;
|
||||||
|
}
|
||||||
|
|
||||||
async loadEvents(dir?: string) {
|
async loadEvents(dir?: string) {
|
||||||
dir ??= await this.getRC().then(x => ('events' in x.locations ? x.locations.events : undefined));
|
dir ??= await this.getRC().then(x => x.locations.events);
|
||||||
if (dir) {
|
if (dir) {
|
||||||
await this.events.load(dir);
|
await this.events.load(dir);
|
||||||
this.logger.info('EventHandler loaded');
|
this.logger.info('EventHandler loaded');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user