Hierarchy

Constructors

Properties

#events: EventEmitter<string | symbol, any> = ...
#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 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

    Returns Promise<object>

  • Parameters

    • m: GuildMember | PartialGuildMember

    Returns Promise<void>

  • This is only for internal use!

    Parameters

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

    Returns Promise<undefined | null>

  • Parameters

    • message: Message<boolean>

    Returns Promise<undefined | null>

  • Emits when the cooldown is added for the user

    Parameters

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

          Returns unknown

    Returns EventEmitter<string | symbol, any>

  • Emits when someone levels up in a server.

    Parameters

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

          • member: GuildMember
          • profile: Users & {
                _id: string;
            }
          • server: Settings & {
                _id: string;
            }
          • level: number
          • channel: null | GuildChannel

          Returns unknown

    Returns EventEmitter<string | symbol, any>

  • Emits when someone gains xp in a server.

    Parameters

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

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

          Returns unknown

    Returns EventEmitter<string | symbol, any>

  • Parameters

    • db: Settings
    • channel: TextBasedChannel
    • channelId: string
    • options: sendOptions

    Returns Promise<null | void | Message<true> | APIMessage>

  • Parameters

    Returns Promise<null | void | Message<true> | APIMessage>

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

    Returns Promise<undefined | true>

  • Parameters

    • old: VoiceState
    • voice: VoiceState

    Returns Promise<void>

  • Parameters

    • guild: Guild

    Returns GuildWebhook

Generated using TypeDoc