Class: toExport

Patreon~ toExport

The object to put into the SpikeyBot object. This contains all of the public data available through that interface. Data will be available after Patreon.initialize has been called, at `SpikeyBot.patreon`.

new toExport()

Source:

Methods


<static> checkAllPerms(uId, cId, gId, perm, cb)

Check that a user or channel or guild has permission for something. Checks overrides for each, and if the user does not have an override, the request is forwarded to toExport.checkPerm.
Parameters:
Name Type Argument Description
uId string | number The Discord user ID to check.
cId string | number The Discord channel ID to check.
gId string | number The Discord guild ID to check.
perm string <nullable>
The permission string to check against. Null to check for overrides only.
cb Patreon~basicCB Callback with parameters for error and success values.
Properties
Name Type Description
data.status boolean If the given IDs have permission.
Source:

<static> checkPerm(uId, perm, cb)

Check that a user has a specific permission. Permissions are defined in Patreon~patreonTierPermFile. This does not check overrides.
Parameters:
Name Type Description
uId string | number The Discord user ID to check.
perm string The permission string to check against.
cb Patreon~basicCB Callback with parameters for error and success values.
Properties
Name Type Description
data.status boolean If the user has permission.
Source:

<static> getAllPerms(uId, cId, gId, cb)

Fetch all permissions for a given user, channel, or guild.
Parameters:
Name Type Description
uId string | number The ID of the Discord user.
cId string | number The Discord channel ID.
gId string | number The Discord guild ID.
cb Patreon~basicCB Callback once operation is complete.
Source:

<static> getLevelPerms(pledgeAmount, exclusive, cb)

Responds with all permissions available at the given pledge amount.
Parameters:
Name Type Description
pledgeAmount number The amount in cents that the user has pledged.
exclusive boolean Only get the rewards received at the exact pledge amount. Does not show all tier rewards below the pledge amount.
cb Patreon~basicCB Callback with parameters for error and success values.
Properties
Name Type Description
data.status Array.<string> All of the permission strings.
Source:

<static> getSettingValue(uId, cId, gId, permString, cb)

Responds with the settings value for a user if they have permission for the setting, otherwise replies with the default value.
Parameters:
Name Type Description
uId number | string The user id to check, or null to get the default value.
cId number | string The Discord channel id to check, or null to get the default value.
gId number | string The Discord guild id to check, or null to get the default value.
permString string The permission to check with subvalues separated by spaces.
cb Patreon~basicCB Callback with parameters for error and success values.
Properties
Name Type Description
data.status * The setting's value.
Source: