User
Get User
GetAPIUser
Returns a user object for a given user ID, defaults to self.
import { getUser } from "dressed";
const user = await getUser(userId?);Modify User
PatchAPICurrentUser
Modify the requester's user account settings.
import { modifyUser } from "dressed";
await modifyUser(data);List Guilds
GetAPICurrentUserGuilds
Returns a list of partial guild objects the current user is a member of.
import { listGuilds } from "dressed";
const guilds = await listGuilds(params?);- For OAuth2, requires the
guildsscope. - This endpoint returns 200 guilds by default, which is the maximum number of guilds a non-bot user can join. Therefore, pagination is not needed for integrations that need to get a list of the users' guilds.
Get Current User Member
GetAPIUserGuildMember
Returns a guild member object for the current user.
import { getCurrentUserMember } from "dressed";
const currentUserMember = await getCurrentUserMember(guildId);Requires the guilds.members.read OAuth2 scope.
Bots cannot use this endpoint
Leave Guild
DeleteAPICurrentUserGuild
Leave a guild.
import { leaveGuild } from "dressed";
await leaveGuild(guildId);Create DM
PostAPICurrentUserCreateDMChannel
Create a new DM channel with a user.
import { createDM } from "dressed";
await createDM(data);You should not use this endpoint to DM everyone in a server about something. DMs should generally be initiated by a user action. If you open a significant amount of DMs too quickly, your bot may be rate limited or blocked from opening new ones.
List Connections
GetAPICurrentUserConnections
Returns a list of connection objects.
import { listConnections } from "dressed";
const connections = await listConnections();Requires the connections OAuth2 scope.
Get Role Connection
GetAPICurrentUserApplicationRoleConnection
Returns the application role connection for the user.
import { getRoleConnection } from "dressed";
const roleConnection = await getRoleConnection(applicationId);Requires the connections OAuth2 scope.
Modify Role Connection
PutAPICurrentUserApplicationRoleConnection
Updates and returns the application role connection for the user.
import { modifyRoleConnection } from "dressed";
await modifyRoleConnection(applicationId, data);Requires the connections OAuth2 scope.