Closed KevinNovak closed 4 years ago
could you test it like this? (i dont have a ts compiler, so im just going off of what vscode's intelisense shows)
export * from "discord.js"
declare module "discord.js-light" {
import * as Discord from "discord.js"
interface ClientOptions {
cacheChannels?:boolean,
cacheGuilds?:boolean,
cachePresences?:boolean,
cacheRoles?:boolean,
cacheOverwrites?:boolean,
cacheEmojis?:boolean
}
interface ClientEvents {
rest:[{path:string,method:string,response:Promise<Buffer>}],
shardConnect:[number,Discord.Collection<Discord.Snowflake,Discord.Guild>],
guildEmojisUpdate:[Discord.Collection<Discord.Snowflake,Discord.GuildEmoji>]
}
class Client extends Discord.Client {
public sweepUsers(lifetime: number): void;
public sweepChannels(lifetime: number): void;
}
}
Here is what happens with that code when I run tsc
(the typescript compiler):
You can install typescript compiler as well with:
npm install -g typescript
Then you should have the tsc
command.
how about this. No errors when running tsc, but im not sure if i ran it right
import * as Discord from "discord.js"
export * from "discord.js"
export class Client extends Discord.Client {
public sweepUsers(lifetime: number): void;
public sweepChannels(lifetime: number): void;
}
declare module "discord.js-light" {
interface ClientOptions {
cacheChannels?:boolean,
cacheGuilds?:boolean,
cachePresences?:boolean,
cacheRoles?:boolean,
cacheOverwrites?:boolean,
cacheEmojis?:boolean
}
interface ClientEvents {
rest:[{path:string,method:string,response:Promise<Buffer>}],
shardConnect:[number,Discord.Collection<Discord.Snowflake,Discord.Guild>],
guildEmojisUpdate:[Discord.Collection<Discord.Snowflake,Discord.GuildEmoji>]
}
}
With this code, I no longer need to import from discord.js, everything can be imported from discord.js-light:
This includes the extra client options combined with the original options from discord.js:
All compiles good. Looks great!
Awesome. Add it to you PR and i'll merge
Added. Thanks!
Fix for: