🎨 use discord-server-util
This commit is contained in:
parent
f5a723d9b4
commit
43ce48e7c6
@ -1,5 +0,0 @@
|
|||||||
import { MongoDatabase } from "lambert-db";
|
|
||||||
|
|
||||||
const db = new MongoDatabase();
|
|
||||||
|
|
||||||
export default db;
|
|
19
src/util/Config.ts
Normal file
19
src/util/Config.ts
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import { Config } from "discord-server-util";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
init() {
|
||||||
|
return Config.init({ gateway: DefaultOptions });
|
||||||
|
},
|
||||||
|
get() {
|
||||||
|
return Config.getAll().gateway;
|
||||||
|
},
|
||||||
|
set(val: any) {
|
||||||
|
return Config.setAll({ gateway: val });
|
||||||
|
},
|
||||||
|
getAll: Config.getAll,
|
||||||
|
setAll: Config.setAll,
|
||||||
|
};
|
||||||
|
|
||||||
|
export interface DefaultOptions {}
|
||||||
|
|
||||||
|
export const DefaultOptions: DefaultOptions = {};
|
37
src/util/Constants.ts
Normal file
37
src/util/Constants.ts
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
export enum OPCODES {
|
||||||
|
Dispatch,
|
||||||
|
Heartbeat,
|
||||||
|
Identify,
|
||||||
|
Presence_Update,
|
||||||
|
Voice_State_Update,
|
||||||
|
Resume,
|
||||||
|
Reconnect,
|
||||||
|
Request_Guild_Members,
|
||||||
|
Invalid_Session,
|
||||||
|
Hello,
|
||||||
|
Heartbeat_ACK,
|
||||||
|
}
|
||||||
|
export enum CLOSECODES {
|
||||||
|
Unknown_error = 4000,
|
||||||
|
Unknown_opcode,
|
||||||
|
Decode_error,
|
||||||
|
Not_authenticated,
|
||||||
|
Authentication_failed,
|
||||||
|
Already_authenticated,
|
||||||
|
Invalid_session,
|
||||||
|
Invalid_seq,
|
||||||
|
Rate_limited,
|
||||||
|
Session_timed_out,
|
||||||
|
Invalid_shard,
|
||||||
|
Sharding_required,
|
||||||
|
Invalid_API_version,
|
||||||
|
Invalid_intent,
|
||||||
|
Disallowed_intent,
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Payload {
|
||||||
|
op: OPCODES;
|
||||||
|
d?: any;
|
||||||
|
s?: number;
|
||||||
|
t?: string;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user