Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "general"

Index

Functions

awaitMessages

  • awaitMessages(channel: TextChannel, member: GuildMember): Promise<string>
  • Awaits a single message for 60 seconds and throws on time

    Parameters

    • channel: TextChannel
    • member: GuildMember

    Returns Promise<string>

capitalise

  • capitalise(str: string): string
  • Capitalises each first letter of a word in a string.

    Parameters

    • str: string

    Returns string

countUniqueWords

  • countUniqueWords(message: string): number
  • Counts the number of unique words in a sentence

    Parameters

    • message: string

    Returns number

createLogMessage

  • createLogMessage(message: string, alertLevel: AlertLevel): string
  • Creates logging messages

    Parameters

    • message: string
    • alertLevel: AlertLevel

    Returns string

hasRole

  • hasRole(guild: Guild, role: string, member: Snowflake): boolean
  • Checks whether member has a specific role

    Parameters

    • guild: Guild
    • role: string
    • member: Snowflake

    Returns boolean

notify

  • notify(options: NotificationOptions): Promise<Message>
  • Sends notification to specified channel

    Parameters

    • options: NotificationOptions

    Returns Promise<Message>

parseChannelMention

  • parseChannelMention(mention: string): string | undefined
  • Parses a channel mention and returns the id

    Parameters

    • mention: string

    Returns string | undefined

parseMemberMention

  • parseMemberMention(mention: string): string | undefined
  • Parses a member mention and returns the id

    Parameters

    • mention: string

    Returns string | undefined

parseRoleMention

  • parseRoleMention(mention: string): string | undefined
  • Parses a member mention and returns the id

    Parameters

    • mention: string

    Returns string | undefined

transformObject

  • transformObject<T>(first: Record<string, unknown>, second: Record<string, unknown>): T
  • Transforms an object to include only keys available in another object. Doesn't handle nested objects.

    Type parameters

    • T

    Parameters

    • first: Record<string, unknown>
    • second: Record<string, unknown>

    Returns T

Generated using TypeDoc