Resolver(client)

The base resolver class

new Resolver(client)

Parameters:
Name Type Description
client KomadaClient The Komada Client

Methods

async boolean(bool) → {Promise.<?boolean>}

Resolve a Boolean instance.
Parameters:
Name Type Description
bool boolean | string The boolean to validate.
Returns:
Promise.<?boolean>

async channel(channel) → {Promise.<?Channel>}

Resolve a Channel object by its instance of Channel, or by its Snowflake.
Parameters:
Name Type Description
channel Channel The channel to validate.
Returns:
Promise.<?Channel>

async float(number) → {Promise.<?number>}

Resolve a Float.
Parameters:
Name Type Description
number string | number The float to validate.
Returns:
Promise.<?number>

async guild(guild) → {Promise.<?Guild>}

Resolve a Guild object by its instance of Guild, or by its Snowflake.
Parameters:
Name Type Description
guild Guild The guild to validate/find.
Returns:
Promise.<?Guild>

async integer(integer) → {Promise.<?number>}

Resolve an Integer.
Parameters:
Name Type Description
integer string | number The integer to validate.
Returns:
Promise.<?number>

async member(member, guild) → {Promise.<?GuildMember>}

Resolve a GuildMember object by its instance of GuildMember, User, or by its Snowflake.
Parameters:
Name Type Description
member GuildMember | User | Snowflake The number to validate.
guild Guild The Guild object in which the member can be found.
Returns:
Promise.<?GuildMember>

async msg(message, channel) → {Promise.<?Message>}

Fetch a Message object by its Snowflake or instanceof Message.
Parameters:
Name Type Description
message Snowflake The message snowflake to validate.
channel Channel The Channel object in which the message can be found.
Returns:
Promise.<?Message>

async msgs(message, channel, limitopt) → {Promise.<?Collection.<Message>>}

Fetch messages by a snowflake or instanceof Message
Parameters:
Name Type Attributes Default Description
message Snowflake The message snowflake to validate.
channel Channel The Channel object in which the message can be found.
limit number <optional>
100 The number of messages to fetch and send back.
Returns:
Promise.<?Collection.<Message>>

async role(role, guild) → {Promise.<?Role>}

Resolve a Role object by its instance of Role, or by its Snowflake.
Parameters:
Name Type Description
role Role The role to validate/find.
guild Guild The Guild object in which the role can be found.
Returns:
Promise.<?Role>

async string(string) → {Promise.<?string>}

Resolve a String instance.
Parameters:
Name Type Description
string string The string to validate.
Returns:
Promise.<?string>

async url(hyperlink) → {Promise.<?string>}

Resolve a hyperlink.
Parameters:
Name Type Description
hyperlink string The hyperlink to validate.
Returns:
Promise.<?string>

async user(user) → {Promise.<?User>}

Resolve a User object by its instance of User, GuildMember, or by its Snowflake.
Parameters:
Name Type Description
user User The user to validate.
Returns:
Promise.<?User>