Create a new User Method handler
Usually SnowTransfer creates a method handler for you, this is here for completion
You can access the methods listed via client.user.method
, where client
is an initialized SnowTransfer instance
Create a direct message channel with another user
You can not create a dm with another bot
// Create a dm channel and send "hi" to it
const client = new SnowTransfer("TOKEN")
const channel = await client.user.createDirectMessageChannel("other user id")
client.channel.createMessage(channel.id, "hi")
Id of the user to create the direct message channel with
Get guilds of the current user
Array of partial guild objects
const client = new SnowTransfer("TOKEN")
const guilds = await client.user.getGuilds()
Optional
query: { Optional
after?: stringOptional
before?: stringOptional
limit?: numberUpdate the current user
// update the avatar of the user
const client = new SnowTransfer("TOKEN")
const fileData = fs.readFileSync("new_avatar.png") // You should probably use fs.readFile, since it is asynchronous, synchronous methods may lag your bot.
const updateData = {
avatar: data:image/png;base64,${fileData.toString("base64")}
// base64 data url: data:mimetype;base64,base64String
}
client.user.updateSelf(updateData)
The new data of the CurrentUser
Optional
avatar?: null | stringOptional
username?: stringGenerated using TypeDoc
Methods for interacting with users