Update
1. Fix Interaction with ephemeral message 2. client.updateCookie() 3. clientUser.findFriend('test', 1234) 4. WebEmbed not working, sad 5. Update Document later ...
This commit is contained in:
@@ -156,9 +156,10 @@ class ClientUser extends User {
|
||||
async setHypeSquad(type) {
|
||||
const id = typeof type === 'string' ? HypeSquadOptions[type] : type;
|
||||
if (!id && id !== 0) throw new Error('Invalid HypeSquad type.');
|
||||
if (id !== 0) return await this.client.api.hypesquad.online.post({
|
||||
data: { house_id: id },
|
||||
});
|
||||
if (id !== 0)
|
||||
return await this.client.api.hypesquad.online.post({
|
||||
data: { house_id: id },
|
||||
});
|
||||
else return await this.client.api.hypesquad.online.delete();
|
||||
}
|
||||
|
||||
@@ -178,7 +179,8 @@ class ClientUser extends User {
|
||||
* @returns {Promise}
|
||||
*/
|
||||
setDiscriminator(discriminator, password) {
|
||||
if (!this.nitro) throw new Error('You must be a Nitro User to change your discriminator.');
|
||||
if (!this.nitro)
|
||||
throw new Error('You must be a Nitro User to change your discriminator.');
|
||||
if (!password && !this.client.password)
|
||||
throw new Error('A password is required to change a discriminator.');
|
||||
return this.edit({
|
||||
@@ -352,6 +354,22 @@ class ClientUser extends User {
|
||||
setAFK(afk = true, shardId) {
|
||||
return this.setPresence({ afk, shardId });
|
||||
}
|
||||
|
||||
/**
|
||||
* Send Friend Request to the user
|
||||
* @returns {Promise<User>} the user object
|
||||
*/
|
||||
async findFriend(username, discriminator) {
|
||||
return await this.client.api
|
||||
.users('@me')
|
||||
.relationships.post({
|
||||
data: {
|
||||
username: username,
|
||||
discriminator: parseInt(discriminator),
|
||||
},
|
||||
})
|
||||
.then((_) => _);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ClientUser;
|
||||
|
@@ -183,6 +183,7 @@ class MessageButton extends BaseMessageComponent {
|
||||
component_type: 2, // Button
|
||||
custom_id: this.customId
|
||||
},
|
||||
message_flags: message.flags.bitfield,
|
||||
}
|
||||
}
|
||||
)
|
||||
|
@@ -231,24 +231,23 @@ class MessageSelectMenu extends BaseMessageComponent {
|
||||
return false;
|
||||
})
|
||||
if (check_) throw new RangeError("[SELECT_MENU_INVALID_VALUE] The value " + check_ + " is invalid. Please use a valid value " + validValue.join(', '));
|
||||
await message.client.api.interactions.post(
|
||||
{
|
||||
data: {
|
||||
type: 3, // ?
|
||||
guild_id: message.guild?.id ?? null, // In DMs
|
||||
channel_id: message.channel.id,
|
||||
message_id: message.id,
|
||||
application_id: message.author.id,
|
||||
session_id: message.client.session_id,
|
||||
data: {
|
||||
component_type: 3, // Select Menu
|
||||
custom_id: this.customId,
|
||||
type: 3, // Select Menu
|
||||
values,
|
||||
},
|
||||
}
|
||||
}
|
||||
)
|
||||
await message.client.api.interactions.post({
|
||||
data: {
|
||||
type: 3, // ?
|
||||
guild_id: message.guild?.id ?? null, // In DMs
|
||||
channel_id: message.channel.id,
|
||||
message_id: message.id,
|
||||
application_id: message.author.id,
|
||||
session_id: message.client.session_id,
|
||||
data: {
|
||||
component_type: 3, // Select Menu
|
||||
custom_id: this.customId,
|
||||
type: 3, // Select Menu
|
||||
values,
|
||||
},
|
||||
message_flags: message.flags.bitfield,
|
||||
},
|
||||
});
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@@ -1,13 +1,18 @@
|
||||
'use strict';
|
||||
const axios = require('axios');
|
||||
const baseURL = 'https://embed.benny.fun/?';
|
||||
const baseURL = 'https://embed.benny.fun/?'; // error, not working .-. sad ...
|
||||
const hiddenCharter =
|
||||
'||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||';
|
||||
const { RangeError } = require('../errors');
|
||||
const Util = require('../util/Util');
|
||||
const process = require('node:process');
|
||||
const warn = true;
|
||||
|
||||
class WebEmbed {
|
||||
constructor(data = {}) {
|
||||
if (warn) process.emitWarning(
|
||||
'The WebEmbed constructor encountered a problem with the URL.',
|
||||
);
|
||||
this._setup(data);
|
||||
/**
|
||||
* Shorten the link
|
||||
|
Reference in New Issue
Block a user