Options
All
  • Public
  • Public/Protected
  • All
Menu

Module src/utils

Index

Variables

delay: 1000 = 1000

Functions

  • get(url: string, headers: string): Promise<IJSONResponse<unknown>>
  • GET request to scathach bot API

    Parameters

    • url: string

      The related endpoint

    • headers: string

      custom headers that you pass to the request

    Returns Promise<IJSONResponse<unknown>>

    Promise that resolves to the response body

  • randomArray(arr: string, path?: string): string
  • Shuffles array in place.

    Parameters

    • arr: string

      An array containing the items.

    • path: string = ''

      callback path

    Returns string

    shuffled array

  • ratelimit(time: number, data: string): Promise<unknown>
  • Rate limit handling for shit users which spamming the API

    Parameters

    • time: number

      The time in milliseconds

    • data: string

      The data that represents from get()

    Returns Promise<unknown>

    resolved the requests

Generated using TypeDoc