Hierarchy

Constructors

Properties

#cache: Map<string, UserCache> = ...

Internal cache for user cooldowns

#events: __module = ...
#listening: boolean = false

A boolean to make sure the package only listens to the events ONCE

#url: string
api: API = ...

The manager to configure the leveling data ()

client: Client<boolean>
dbs: {
    settings: Model<Settings, {}, {}, {}, Document<unknown, {}, Settings> & Settings & {
        _id: ObjectId;
    }, Schema<Settings, Model<Settings, any, any, any, Document<unknown, any, Settings> & Settings & {
        _id: ObjectId;
    }, any>, {}, {}, {}, {}, DefaultSchemaOptions, Settings, Document<unknown, {}, FlatRecord<Settings>> & FlatRecord<Settings> & {
        _id: ObjectId;
    }>>;
    users: Model<Users, {}, {}, {}, Document<unknown, {}, Users> & Users & {
        _id: ObjectId;
    }, Schema<Users, Model<Users, any, any, any, Document<unknown, any, Users> & Users & {
        _id: ObjectId;
    }, any>, {}, {}, {}, {}, DefaultSchemaOptions, Users, Document<unknown, {}, FlatRecord<Users>> & FlatRecord<Users> & {
        _id: ObjectId;
    }>>;
    weekly: Model<Weekly, {}, {}, {}, Document<unknown, {}, Weekly> & Weekly & {
        _id: ObjectId;
    }, Schema<Weekly, Model<Weekly, any, any, any, Document<unknown, any, Weekly> & Weekly & {
        _id: ObjectId;
    }, any>, {}, {}, {}, {}, DefaultSchemaOptions, Weekly, Document<unknown, {}, FlatRecord<Weekly>> & FlatRecord<Weekly> & {
        _id: ObjectId;
    }>>;
} = ...

Type declaration

  • settings: Model<Settings, {}, {}, {}, Document<unknown, {}, Settings> & Settings & {
        _id: ObjectId;
    }, Schema<Settings, Model<Settings, any, any, any, Document<unknown, any, Settings> & Settings & {
        _id: ObjectId;
    }, any>, {}, {}, {}, {}, DefaultSchemaOptions, Settings, Document<unknown, {}, FlatRecord<Settings>> & FlatRecord<Settings> & {
        _id: ObjectId;
    }>>
  • users: Model<Users, {}, {}, {}, Document<unknown, {}, Users> & Users & {
        _id: ObjectId;
    }, Schema<Users, Model<Users, any, any, any, Document<unknown, any, Users> & Users & {
        _id: ObjectId;
    }, any>, {}, {}, {}, {}, DefaultSchemaOptions, Users, Document<unknown, {}, FlatRecord<Users>> & FlatRecord<Users> & {
        _id: ObjectId;
    }>>
  • weekly: Model<Weekly, {}, {}, {}, Document<unknown, {}, Weekly> & Weekly & {
        _id: ObjectId;
    }, Schema<Weekly, Model<Weekly, any, any, any, Document<unknown, any, Weekly> & Weekly & {
        _id: ObjectId;
    }, any>, {}, {}, {}, {}, DefaultSchemaOptions, Weekly, Document<unknown, {}, FlatRecord<Weekly>> & FlatRecord<Weekly> & {
        _id: ObjectId;
    }>>

Accessors

  • get cache(): {
        clear: {
            server: ((guildId) => boolean[]);
            user: ((userId, guildId) => boolean);
        };
    }
  • Returns {
        clear: {
            server: ((guildId) => boolean[]);
            user: ((userId, guildId) => boolean);
        };
    }

    • clear: {
          server: ((guildId) => boolean[]);
          user: ((userId, guildId) => boolean);
      }
      • server: ((guildId) => boolean[])
          • (guildId): boolean[]
          • Delete all users from a server's cooldown

            Parameters

            • guildId: string

            Returns boolean[]

      • user: ((userId, guildId) => boolean)
          • (userId, guildId): boolean
          • Delete a user from a server's cooldown.

            Parameters

            • userId: string
            • guildId: string

            Returns boolean

  • get weekly(): {
        add: ((guildId, data) => Promise<null | Document<unknown, {}, Weekly> & Weekly & {
            _id: ObjectId;
        }>);
        get: ((guildId, id?) => Promise<null | Document<unknown, {}, Weekly> & Weekly & {
            _id: ObjectId;
        }>);
    }
  • Returns {
        add: ((guildId, data) => Promise<null | Document<unknown, {}, Weekly> & Weekly & {
            _id: ObjectId;
        }>);
        get: ((guildId, id?) => Promise<null | Document<unknown, {}, Weekly> & Weekly & {
            _id: ObjectId;
        }>);
    }

    • add: ((guildId, data) => Promise<null | Document<unknown, {}, Weekly> & Weekly & {
          _id: ObjectId;
      }>)
        • (guildId, data): Promise<null | Document<unknown, {}, Weekly> & Weekly & {
              _id: ObjectId;
          }>
        • Parameters

          Returns Promise<null | Document<unknown, {}, Weekly> & Weekly & {
              _id: ObjectId;
          }>

    • get: ((guildId, id?) => Promise<null | Document<unknown, {}, Weekly> & Weekly & {
          _id: ObjectId;
      }>)
        • (guildId, id?): Promise<null | Document<unknown, {}, Weekly> & Weekly & {
              _id: ObjectId;
          }>
        • Parameters

          • guildId: string
          • Optional id: string

          Returns Promise<null | Document<unknown, {}, Weekly> & Weekly & {
              _id: ObjectId;
          }>

Methods

  • Parameters

    • m: GuildMember | PartialGuildMember

    Returns Promise<void>

  • Parameters

    • member: GuildMember
    • currentChannel: null | TextBasedChannel
    • xp: number
    • db: CachedOptions<Settings>
    • Optional voiceMinutes: number

    Returns Promise<void>

  • Parameters

    • message: Message<boolean>

    Returns Promise<void>

  • Parameters

    • old: VoiceState
    • voice: VoiceState

    Returns Promise<void>

  • Parameters

    • userId: string
    • guildId: string

    Returns Promise<null | Document<unknown, {}, Users> & Users & {
        _id: ObjectId;
    }>

  • Emits when the cooldown is added for the user

    Parameters

    • listener: ((message, cooldown) => unknown)
        • (message, cooldown): unknown
        • Parameters

          Returns unknown

    Returns __module

  • Emits when someone levels up in a server.

    Parameters

    • listener: ((member, profile, server) => unknown)
        • (member, profile, server): unknown
        • Parameters

          • member: GuildMember
          • profile: Users & {
                _id: string;
            }
          • server: Settings & {
                _id: string;
            }

          Returns unknown

    Returns __module

  • Emits when someone gains xp in a server.

    Parameters

    • listener: ((member, profile, server) => unknown)
        • (member, profile, server): unknown
        • Parameters

          • member: GuildMember
          • profile: Users & {
                _id: string;
            }
          • server: Settings & {
                _id: string;
            }

          Returns unknown

    Returns __module

  • Use this to start listening for events and automatically handle xp/leveling

    Returns Promise<undefined | true>

Generated using TypeDoc