fix: add client.editStatus()

This commit is contained in:
Skillz
2023-02-28 11:17:29 -06:00
parent 49a7291056
commit 402106e2eb

View File

@@ -151,12 +151,14 @@ import type PermissionOverwrite from './Structures/PermissionOverwrite.js'
import ExtendedUser from './Structures/users/Extended.js'
import User from './Structures/users/User.js'
import type {
ActivityPartial,
AllowedMentions,
AnyChannel,
AnyGuildChannel,
ApplicationCommand,
ApplicationCommandPermissions,
ApplicationCommandStructure,
BotActivityType,
ChannelFollow,
ChannelPosition,
CreateChannelInviteOptions,
@@ -200,6 +202,7 @@ import type {
PruneMemberOptions,
PurgeChannelOptions,
RoleOptions,
SelfStatus,
StageInstanceOptions,
Sticker,
StickerPack,
@@ -1340,6 +1343,13 @@ export class Client extends EventEmitter {
}).then((instance) => new StageInstance(instance, this))
}
/**
* Updates the bot's status on all guilds the shard is in
*/
async editStatus(status: SelfStatus, activities: Array<ActivityPartial<BotActivityType>> | ActivityPartial<BotActivityType> = []) {
return await Promise.all(this.shards.map(async (shard) => await shard.editStatus(status, activities)))
}
/** Edit a webhook */
async editWebhook(webhookID: BigString, options: WebhookOptions, token: string, reason?: string) {
return await this.patch(token ? WEBHOOK_TOKEN(webhookID, token) : WEBHOOK(webhookID), {