mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 01:53:30 +01:00
refactor: ES2021 features (#6540)
Co-authored-by: Antonio Román <kyradiscord@gmail.com> Co-authored-by: Voltrex <mohammadkeyvanzade94@gmail.com>
This commit is contained in:
@@ -53,7 +53,7 @@ class ClientPresence extends Presence {
|
||||
if (activities?.length) {
|
||||
for (const [i, activity] of activities.entries()) {
|
||||
if (typeof activity.name !== 'string') throw new TypeError('INVALID_TYPE', `activities[${i}].name`, 'string');
|
||||
if (!activity.type) activity.type = 0;
|
||||
activity.type ??= 0;
|
||||
|
||||
data.activities.push({
|
||||
type: typeof activity.type === 'number' ? activity.type : ActivityTypes[activity.type],
|
||||
|
||||
Reference in New Issue
Block a user