Downgrade to v13

[vi] cảm giác đau khổ
This commit is contained in:
March 7th
2022-03-24 17:55:32 +07:00
parent 9596b1a210
commit 7dfdef46a5
218 changed files with 8584 additions and 9108 deletions

View File

@@ -1,8 +1,7 @@
'use strict';
const { DiscordSnowflake } = require('@sapphire/snowflake');
const { Routes } = require('discord-api-types/v9');
const Base = require('./Base');
const SnowflakeUtil = require('../util/SnowflakeUtil');
/**
* The base class for {@link Guild}, {@link OAuth2Guild} and {@link InviteGuild}.
@@ -33,7 +32,7 @@ class BaseGuild extends Base {
/**
* An array of features available to this guild
* @type {GuildFeature[]}
* @type {Features[]}
*/
this.features = data.features;
}
@@ -44,7 +43,7 @@ class BaseGuild extends Base {
* @readonly
*/
get createdTimestamp() {
return DiscordSnowflake.timestampFrom(this.id);
return SnowflakeUtil.timestampFrom(this.id);
}
/**
@@ -88,11 +87,12 @@ class BaseGuild extends Base {
/**
* The URL to this guild's icon.
* @param {ImageURLOptions} [options={}] Options for the image URL
* @param {ImageURLOptions} [options={}] Options for the Image URL
* @returns {?string}
*/
iconURL(options = {}) {
return this.icon && this.client.rest.cdn.icon(this.id, this.icon, options);
iconURL({ format, size, dynamic } = {}) {
if (!this.icon) return null;
return this.client.rest.cdn.Icon(this.id, this.icon, format, size, dynamic);
}
/**
@@ -100,9 +100,7 @@ class BaseGuild extends Base {
* @returns {Promise<Guild>}
*/
async fetch() {
const data = await this.client.api.guilds(this.id).get({
query: new URLSearchParams({ with_counts: true }),
});
const data = await this.client.api.guilds(this.id).get({ query: { with_counts: true } });
return this.client.guilds._add(data);
}