From 836a1d341f217bab8db1256da8a302bac631de63 Mon Sep 17 00:00:00 2001 From: Ethan Lane Date: Fri, 17 May 2024 20:57:01 +0100 Subject: [PATCH 1/4] Add cron job to add coins to a user every 30 minutes (#219) # Description Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. - Added a timer helper to run timers on a cron job - Added a currency timer function to give a user 5 currency every 30 minutes #204 ## Type of change Please delete options that are not relevant. - [x] New feature (non-breaking change which adds functionality) # How Has This Been Tested? Please describe the tests that you ran to verify the changes. Provide instructions so we can reproduce. Please also list any relevant details to your test configuration. # Checklist - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that provde my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published in downstream modules Reviewed-on: https://git.vylpes.xyz/External/card-drop/pulls/219 Reviewed-by: VylpesTester Co-authored-by: Ethan Lane Co-committed-by: Ethan Lane --- package-lock.json | 23 +++++++++ package.json | 1 + src/bot.ts | 1 - src/client/client.ts | 11 ++++- src/contracts/AppBaseEntity.ts | 6 +++ src/database/entities/app/User.ts | 4 -- src/helpers/TimerHelper.ts | 81 +++++++++++++++++++++++++++++++ src/registry.ts | 4 -- src/timers/GiveCurrency.ts | 16 ++++++ src/type/primitive.ts | 1 + 10 files changed, 138 insertions(+), 10 deletions(-) create mode 100644 src/helpers/TimerHelper.ts create mode 100644 src/timers/GiveCurrency.ts create mode 100644 src/type/primitive.ts diff --git a/package-lock.json b/package-lock.json index 6d144ca..54614bc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,7 @@ "@types/uuid": "^9.0.0", "body-parser": "^1.20.2", "clone-deep": "^4.0.1", + "cron": "^3.1.7", "discord.js": "^14.3.0", "dotenv": "^16.0.0", "express": "^4.18.2", @@ -1895,6 +1896,11 @@ "@types/node": "*" } }, + "node_modules/@types/luxon": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/@types/luxon/-/luxon-3.4.2.tgz", + "integrity": "sha512-TifLZlFudklWlMBfhubvgqTXRzLDI5pCbGa4P8a3wPyUQSW+1xQ5eDsreP9DWHX3tjq1ke96uYG/nwundroWcA==" + }, "node_modules/@types/mime": { "version": "3.0.4", "license": "MIT" @@ -3841,6 +3847,15 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/cron": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/cron/-/cron-3.1.7.tgz", + "integrity": "sha512-tlBg7ARsAMQLzgwqVxy8AZl/qlTc5nibqYwtNGoCrd+cV+ugI+tvZC1oT/8dFH8W455YrywGykx/KMmAqOr7Jw==", + "dependencies": { + "@types/luxon": "~3.4.0", + "luxon": "~3.4.0" + } + }, "node_modules/cross-spawn": { "version": "7.0.3", "license": "MIT", @@ -7700,6 +7715,14 @@ "node": ">=10" } }, + "node_modules/luxon": { + "version": "3.4.4", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.4.4.tgz", + "integrity": "sha512-zobTr7akeGHnv7eBOXcRgMeCP6+uyYsczwmeRCauvpvaAltgNyTbLH/+VaEAPUeWBT+1GuNmz4wC/6jtQzbbVA==", + "engines": { + "node": ">=12" + } + }, "node_modules/magic-bytes.js": { "version": "1.6.0", "license": "MIT" diff --git a/package.json b/package.json index 178f288..004cfb8 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "@types/uuid": "^9.0.0", "body-parser": "^1.20.2", "clone-deep": "^4.0.1", + "cron": "^3.1.7", "discord.js": "^14.3.0", "dotenv": "^16.0.0", "express": "^4.18.2", diff --git a/src/bot.ts b/src/bot.ts index 87008c5..e5e25a3 100644 --- a/src/bot.ts +++ b/src/bot.ts @@ -37,7 +37,6 @@ const client = new CoreClient([ ]); Registry.RegisterCommands(); -Registry.RegisterEvents(); Registry.RegisterButtonEvents(); if (!existsSync(`${process.env.DATA_DIR}/cards`) && process.env.GDRIVESYNC_AUTO && process.env.GDRIVESYNC_AUTO == "true") { diff --git a/src/client/client.ts b/src/client/client.ts index c694950..2dd9a29 100644 --- a/src/client/client.ts +++ b/src/client/client.ts @@ -14,6 +14,8 @@ import Webhooks from "../webhooks"; import CardMetadataFunction from "../Functions/CardMetadataFunction"; import { SeriesMetadata } from "../contracts/SeriesMetadata"; import AppLogger from "./appLogger"; +import TimerHelper from "../helpers/TimerHelper"; +import GiveCurrency from "../timers/GiveCurrency"; export class CoreClient extends Client { private static _commandItems: ICommandItem[]; @@ -23,6 +25,7 @@ export class CoreClient extends Client { private _events: Events; private _util: Util; private _webhooks: Webhooks; + private _timerHelper: TimerHelper; public static ClaimId: string; public static Environment: Environment; @@ -59,6 +62,7 @@ export class CoreClient extends Client { this._events = new Events(); this._util = new Util(); this._webhooks = new Webhooks(); + this._timerHelper = new TimerHelper(); AppLogger.LogInfo("Client", `Environment: ${CoreClient.Environment}`); @@ -72,7 +76,12 @@ export class CoreClient extends Client { } await AppDataSource.initialize() - .then(() => AppLogger.LogInfo("Client", "App Data Source Initialised")) + .then(() => { + AppLogger.LogInfo("Client", "App Data Source Initialised"); + + const timerId = this._timerHelper.AddTimer("*/30 * * * * *", "Europe/London", GiveCurrency, false); + this._timerHelper.StartTimer(timerId); + }) .catch(err => { AppLogger.LogError("Client", "App Data Source Initialisation Failed"); AppLogger.LogError("Client", err); diff --git a/src/contracts/AppBaseEntity.ts b/src/contracts/AppBaseEntity.ts index b9ca565..3eb9684 100644 --- a/src/contracts/AppBaseEntity.ts +++ b/src/contracts/AppBaseEntity.ts @@ -27,6 +27,12 @@ export default class AppBaseEntity { await repository.save(entity); } + public static async SaveAll(target: EntityTarget, entities: DeepPartial[]): Promise { + const repository = AppDataSource.getRepository(target); + + await repository.save(entities); + } + public static async Remove(target: EntityTarget, entity: T): Promise { const repository = AppDataSource.getRepository(target); diff --git a/src/database/entities/app/User.ts b/src/database/entities/app/User.ts index 4c5798d..a909552 100644 --- a/src/database/entities/app/User.ts +++ b/src/database/entities/app/User.ts @@ -13,10 +13,6 @@ export default class User extends AppBaseEntity { @Column() Currency: number; - public UpdateCurrency(currency: number) { - this.Currency = currency; - } - public AddCurrency(amount: number) { this.Currency += amount; } diff --git a/src/helpers/TimerHelper.ts b/src/helpers/TimerHelper.ts new file mode 100644 index 0000000..535a6a7 --- /dev/null +++ b/src/helpers/TimerHelper.ts @@ -0,0 +1,81 @@ +import { CronJob } from "cron"; +import { v4 } from "uuid"; +import { Primitive } from "../type/primitive"; + +interface Timer { + id: string; + job: CronJob; + context: Map; + onTick: ((context: Map) => void) | ((context: Map) => Promise); + runOnStart: boolean; +} + +export default class TimerHelper { + private _timers: Timer[]; + + constructor() { + this._timers = []; + } + + public AddTimer( + cronTime: string, + timeZone: string, + onTick: ((context: Map) => void) | ((context: Map) => Promise), + runOnStart: boolean = false): string { + const context = new Map(); + + const job = new CronJob( + cronTime, + () => { + onTick(context); + }, + null, + false, + timeZone, + ); + + const id = v4(); + + this._timers.push({ + id, + job, + context, + onTick, + runOnStart, + }); + + return id; + } + + public StartAllTimers() { + this._timers.forEach(timer => this.StartJob(timer)); + } + + public StopAllTimers() { + this._timers.forEach(timer => timer.job.stop()); + } + + public StartTimer(id: string) { + const timer = this._timers.find(x => x.id == id); + + if (!timer) return; + + this.StartJob(timer); + } + + public StopTimer(id: string) { + const timer = this._timers.find(x => x.id == id); + + if (!timer) return; + + timer.job.stop(); + } + + private StartJob(timer: Timer) { + timer.job.start(); + + if (timer.runOnStart) { + timer.onTick(timer.context); + } + } +} \ No newline at end of file diff --git a/src/registry.ts b/src/registry.ts index bb68685..3ea5528 100644 --- a/src/registry.ts +++ b/src/registry.ts @@ -41,10 +41,6 @@ export default class Registry { CoreClient.RegisterCommand("droprarity", new Droprarity(), Environment.Test); } - public static RegisterEvents() { - - } - public static RegisterButtonEvents() { CoreClient.RegisterButtonEvent("claim", new Claim()); CoreClient.RegisterButtonEvent("inventory", new InventoryButtonEvent()); diff --git a/src/timers/GiveCurrency.ts b/src/timers/GiveCurrency.ts new file mode 100644 index 0000000..ad1a21a --- /dev/null +++ b/src/timers/GiveCurrency.ts @@ -0,0 +1,16 @@ +import AppLogger from "../client/appLogger"; +import User from "../database/entities/app/User"; + +export default async function GiveCurrency() { + AppLogger.LogInfo("Timers/GiveCurrency", "Giving currency to every known user"); + + const users = await User.FetchAll(User); + + for (const user of users) { + user.AddCurrency(5); + } + + User.SaveAll(User, users); + + AppLogger.LogInfo("Timers/GiveCurrency", `Successfully gave +5 currency to ${users.length} users`); +} \ No newline at end of file diff --git a/src/type/primitive.ts b/src/type/primitive.ts new file mode 100644 index 0000000..b1e143b --- /dev/null +++ b/src/type/primitive.ts @@ -0,0 +1 @@ +export type Primitive = string | number | boolean; \ No newline at end of file From b8721c253c0300bd030fd7a6c8ec2d84218b28c7 Mon Sep 17 00:00:00 2001 From: Vylpes Date: Fri, 17 May 2024 21:02:52 +0100 Subject: [PATCH 2/4] Create sacrifice command (#225) # Description Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. - Create sacrifice command to be able to reclaim currency - Add confirmation and cancel button events for the sacrifice command so people can confirm they want to do it #203 ## Type of change Please delete options that are not relevant. - [x] New feature (non-breaking change which adds functionality) # How Has This Been Tested? Please describe the tests that you ran to verify the changes. Provide instructions so we can reproduce. Please also list any relevant details to your test configuration. # Checklist - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that provde my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published in downstream modules Reviewed-on: https://git.vylpes.xyz/External/card-drop/pulls/225 Reviewed-by: VylpesTester --- src/buttonEvents/Sacrifice.ts | 147 +++++++++++++++++++++++++ src/commands/sacrifice.ts | 73 ++++++++++++ src/constants/CardRarity.ts | 17 +++ src/database/entities/app/Inventory.ts | 6 + src/registry.ts | 4 + 5 files changed, 247 insertions(+) create mode 100644 src/buttonEvents/Sacrifice.ts create mode 100644 src/commands/sacrifice.ts diff --git a/src/buttonEvents/Sacrifice.ts b/src/buttonEvents/Sacrifice.ts new file mode 100644 index 0000000..6c4a1a6 --- /dev/null +++ b/src/buttonEvents/Sacrifice.ts @@ -0,0 +1,147 @@ +import { ActionRowBuilder, ButtonBuilder, ButtonInteraction, ButtonStyle, EmbedBuilder } from "discord.js"; +import { ButtonEvent } from "../type/buttonEvent"; +import Inventory from "../database/entities/app/Inventory"; +import CardDropHelperMetadata from "../helpers/CardDropHelperMetadata"; +import { CardRarityToString, GetSacrificeAmount } from "../constants/CardRarity"; +import EmbedColours from "../constants/EmbedColours"; +import User from "../database/entities/app/User"; + +export default class Sacrifice extends ButtonEvent { + public override async execute(interaction: ButtonInteraction) { + const subcommand = interaction.customId.split(" ")[1]; + + switch(subcommand) { + case "confirm": + await this.confirm(interaction); + break; + case "cancel": + await this.cancel(interaction); + break; + } + } + + private async confirm(interaction: ButtonInteraction) { + const userId = interaction.customId.split(" ")[2]; + const cardNumber = interaction.customId.split(" ")[3]; + + const cardInInventory = await Inventory.FetchOneByCardNumberAndUserId(userId, cardNumber); + + if (!cardInInventory) { + await interaction.reply("Unable to find card in inventory."); + return; + } + + const cardData = CardDropHelperMetadata.GetCardByCardNumber(cardNumber); + + if (!cardData) { + await interaction.reply("Unable to find card in the database."); + return; + } + + const user = await User.FetchOneById(User, userId); + + if (!user) { + await interaction.reply("Unable to find user in database."); + return; + } + + cardInInventory.RemoveQuantity(1); + + await cardInInventory.Save(Inventory, cardInInventory); + + const cardValue = GetSacrificeAmount(cardData.card.type); + const cardRarityString = CardRarityToString(cardData.card.type); + + user.AddCurrency(cardValue); + + await user.Save(User, user); + + const description = [ + `Card: ${cardData.card.name}`, + `Series: ${cardData.series.name}`, + `Rarity: ${cardRarityString}`, + `Quantity Owned: ${cardInInventory.Quantity}`, + `Sacrifice Amount: ${cardValue}`, + ]; + + const embed = new EmbedBuilder() + .setTitle("Card Sacrificed") + .setDescription(description.join("\n")) + .setColor(EmbedColours.Ok) + .setFooter({ text: `${interaction.user.username} ยท ${cardData.card.name}` }); + + const row = new ActionRowBuilder() + .addComponents([ + new ButtonBuilder() + .setCustomId(`sacrifice confirm ${interaction.user.id} ${cardNumber}`) + .setLabel("Confirm") + .setStyle(ButtonStyle.Success) + .setDisabled(true), + new ButtonBuilder() + .setCustomId("sacrifice cancel") + .setLabel("Cancel") + .setStyle(ButtonStyle.Secondary) + .setDisabled(true), + ]); + + await interaction.update({ + embeds: [ embed ], + components: [ row ], + }); + } + + private async cancel(interaction: ButtonInteraction) { + const userId = interaction.customId.split(" ")[2]; + const cardNumber = interaction.customId.split(" ")[3]; + + const cardInInventory = await Inventory.FetchOneByCardNumberAndUserId(userId, cardNumber); + + if (!cardInInventory) { + await interaction.reply("Unable to find card in inventory."); + return; + } + + const cardData = CardDropHelperMetadata.GetCardByCardNumber(cardNumber); + + if (!cardData) { + await interaction.reply("Unable to find card in the database."); + return; + } + + const cardValue = GetSacrificeAmount(cardData.card.type); + const cardRarityString = CardRarityToString(cardData.card.type); + + const description = [ + `Card: ${cardData.card.name}`, + `Series: ${cardData.series.name}`, + `Rarity: ${cardRarityString}`, + `Quantity Owned: ${cardInInventory.Quantity}`, + `Sacrifice Amount: ${cardValue}`, + ]; + + const embed = new EmbedBuilder() + .setTitle("Sacrifice Cancelled") + .setDescription(description.join("\n")) + .setColor(EmbedColours.Error) + .setFooter({ text: `${interaction.user.username} ยท ${cardData.card.name}` }); + + const row = new ActionRowBuilder() + .addComponents([ + new ButtonBuilder() + .setCustomId(`sacrifice confirm ${interaction.user.id} ${cardNumber}`) + .setLabel("Confirm") + .setStyle(ButtonStyle.Success) + .setDisabled(true), + new ButtonBuilder() + .setCustomId("sacrifice cancel") + .setLabel("Cancel") + .setStyle(ButtonStyle.Secondary) + .setDisabled(true), + ]); + + await interaction.update({ + embeds: [ embed ], + components: [ row ], + }); + } +} \ No newline at end of file diff --git a/src/commands/sacrifice.ts b/src/commands/sacrifice.ts new file mode 100644 index 0000000..c6dc7b3 --- /dev/null +++ b/src/commands/sacrifice.ts @@ -0,0 +1,73 @@ +import { ActionRowBuilder, ButtonBuilder, ButtonStyle, CacheType, CommandInteraction, EmbedBuilder, SlashCommandBuilder } from "discord.js"; +import { Command } from "../type/command"; +import Inventory from "../database/entities/app/Inventory"; +import { CardRarityToString, GetSacrificeAmount } from "../constants/CardRarity"; +import CardDropHelperMetadata from "../helpers/CardDropHelperMetadata"; +import EmbedColours from "../constants/EmbedColours"; + +export default class Sacrifice extends Command { + constructor() { + super(); + + this.CommandBuilder = new SlashCommandBuilder() + .setName("sacrifice") + .setDescription("Sacrifices a card for currency") + .addStringOption(x => + x + .setName("cardnumber") + .setDescription("The card to sacrifice from your inventory") + .setRequired(true)); + } + + public override async execute(interaction: CommandInteraction): Promise { + const cardnumber = interaction.options.get("cardnumber", true); + + const cardInInventory = await Inventory.FetchOneByCardNumberAndUserId(interaction.user.id, cardnumber.value! as string); + + if (!cardInInventory || cardInInventory.Quantity == 0) { + await interaction.reply("Unable to find card in your inventory."); + return; + } + + const cardData = CardDropHelperMetadata.GetCardByCardNumber(cardnumber.value! as string); + + if (!cardData) { + await interaction.reply("Unable to find card in the database."); + return; + } + + const cardValue = GetSacrificeAmount(cardData.card.type); + const cardRarityString = CardRarityToString(cardData.card.type); + + const description = [ + `Card: ${cardData.card.name}`, + `Series: ${cardData.series.name}`, + `Rarity: ${cardRarityString}`, + `Quantity Owned: ${cardInInventory.Quantity}`, + `Sacrifice Amount: ${cardValue}`, + ]; + + const embed = new EmbedBuilder() + .setTitle("Sacrifice") + .setDescription(description.join("\n")) + .setColor(EmbedColours.Grey) + .setFooter({ text: `${interaction.user.username} ยท ${cardData.card.name}` }); + + const row = new ActionRowBuilder() + .addComponents([ + new ButtonBuilder() + .setCustomId(`sacrifice confirm ${interaction.user.id} ${cardnumber.value!}`) + .setLabel("Confirm") + .setStyle(ButtonStyle.Success), + new ButtonBuilder() + .setCustomId(`sacrifice cancel ${interaction.user.id} ${cardnumber.value!}`) + .setLabel("Cancel") + .setStyle(ButtonStyle.Secondary), + ]); + + await interaction.reply({ + embeds: [ embed ], + components: [ row ], + }); + } +} \ No newline at end of file diff --git a/src/constants/CardRarity.ts b/src/constants/CardRarity.ts index 8202a12..82ecee1 100644 --- a/src/constants/CardRarity.ts +++ b/src/constants/CardRarity.ts @@ -58,4 +58,21 @@ export function CardRarityParse(rarity: string): CardRarity { default: return CardRarity.Unknown; } +} + +export function GetSacrificeAmount(rarity: CardRarity): number { + switch (rarity) { + case CardRarity.Bronze: + return 5; + case CardRarity.Silver: + return 15; + case CardRarity.Gold: + return 30; + case CardRarity.Manga: + return 50; + case CardRarity.Legendary: + return 100; + default: + return 0; + } } \ No newline at end of file diff --git a/src/database/entities/app/Inventory.ts b/src/database/entities/app/Inventory.ts index bde4450..a5d0026 100644 --- a/src/database/entities/app/Inventory.ts +++ b/src/database/entities/app/Inventory.ts @@ -29,6 +29,12 @@ export default class Inventory extends AppBaseEntity { this.Quantity = quantity; } + public RemoveQuantity(amount: number) { + if (this.Quantity < amount) return; + + this.Quantity -= amount; + } + public AddClaim(claim: Claim) { this.Claims.push(claim); } diff --git a/src/registry.ts b/src/registry.ts index 3ea5528..15202c5 100644 --- a/src/registry.ts +++ b/src/registry.ts @@ -8,6 +8,7 @@ import Gdrivesync from "./commands/gdrivesync"; import Give from "./commands/give"; import Inventory from "./commands/inventory"; import Resync from "./commands/resync"; +import Sacrifice from "./commands/sacrifice"; import Series from "./commands/series"; import Trade from "./commands/trade"; import View from "./commands/view"; @@ -20,6 +21,7 @@ import Droprarity from "./commands/stage/droprarity"; import Claim from "./buttonEvents/Claim"; import InventoryButtonEvent from "./buttonEvents/Inventory"; import Reroll from "./buttonEvents/Reroll"; +import SacrificeButtonEvent from "./buttonEvents/Sacrifice"; import SeriesEvent from "./buttonEvents/Series"; import TradeButtonEvent from "./buttonEvents/Trade"; @@ -32,6 +34,7 @@ export default class Registry { CoreClient.RegisterCommand("give", new Give()); CoreClient.RegisterCommand("inventory", new Inventory()); CoreClient.RegisterCommand("resync", new Resync()); + CoreClient.RegisterCommand("sacrifice", new Sacrifice()); CoreClient.RegisterCommand("series", new Series()); CoreClient.RegisterCommand("trade", new Trade()); CoreClient.RegisterCommand("view", new View()); @@ -45,6 +48,7 @@ export default class Registry { CoreClient.RegisterButtonEvent("claim", new Claim()); CoreClient.RegisterButtonEvent("inventory", new InventoryButtonEvent()); CoreClient.RegisterButtonEvent("reroll", new Reroll()); + CoreClient.RegisterButtonEvent("sacrifice", new SacrificeButtonEvent()); CoreClient.RegisterButtonEvent("series", new SeriesEvent()); CoreClient.RegisterButtonEvent("trade", new TradeButtonEvent()); } From 40dbf8d2c0e23208f5d5c1345ea06e53fc48e40d Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 20 May 2024 18:21:33 +0100 Subject: [PATCH 3/4] Update dependency @types/node to v20.12.12 (#231) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node) ([source](https://github.com/DefinitelyTyped/DefinitelyTyped)) | devDependencies | patch | [`20.12.11` -> `20.12.12`](https://renovatebot.com/diffs/npm/@types%2fnode/20.12.11/20.12.12) | --- ### Configuration ๐Ÿ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). ๐Ÿšฆ **Automerge**: Disabled by config. Please merge this manually once you are satisfied. โ™ป **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. ๐Ÿ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). Reviewed-on: https://git.vylpes.xyz/External/card-drop/pulls/231 Reviewed-by: Vylpes Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- package-lock.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 54614bc..bd065d7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1906,9 +1906,10 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.12.11", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.11.tgz", - "integrity": "sha512-vDg9PZ/zi+Nqp6boSOT7plNuthRugEKixDv5sFTIpkE89MmNtEArAShI4mxuX2+UrLEe9pxC1vm2cjm9YlWbJw==", + "version": "20.12.12", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.12.tgz", + "integrity": "sha512-eWLDGF/FOSPtAvEqeRAQ4C8LSA7M1I7i0ky1I8U7kD1J5ITyW3AsRhQrKVoWf5pFKZ2kILsEGJhsI9r93PYnOw==", + "license": "MIT", "dependencies": { "undici-types": "~5.26.4" } From caa991a259fd2191886d6149dfa3f15274b6b560 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 20 May 2024 18:24:48 +0100 Subject: [PATCH 4/4] Update dependency @discordjs/rest to v2.3.0 (#232) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@discordjs/rest](https://discord.js.org) ([source](https://github.com/discordjs/discord.js)) | dependencies | minor | [`2.2.0` -> `2.3.0`](https://renovatebot.com/diffs/npm/@discordjs%2frest/2.2.0/2.3.0) | --- ### Release Notes
discordjs/discord.js (@​discordjs/rest) ### [`v2.3.0`](https://github.com/discordjs/discord.js/blob/HEAD/packages/rest/CHANGELOG.md#discordjsrest230---2024-05-04) [Compare Source](https://github.com/discordjs/discord.js/compare/@discordjs/rest@2.2.0...@discordjs/rest@2.3.0) #### Bug Fixes - Anchor link for events ([0efd1be](https://github.com/discordjs/discord.js/commit/0efd1bea46fa2fc8bcd3dcfd0ac5cd608a0a7df0)) #### Documentation - Split docs.api.json into multiple json files ([597340f](https://github.com/discordjs/discord.js/commit/597340f288437c35da8c703d9b621274de60d880)) - Remove hyphen after `@returns` ([#​9989](https://github.com/discordjs/discord.js/issues/9989)) ([e9ff991](https://github.com/discordjs/discord.js/commit/e9ff99101b9800f36839e6158d544c8ef5938d22)) #### Features - Local and preview detection ([79fbda3](https://github.com/discordjs/discord.js/commit/79fbda3aac6d4f0f8bfb193e797d09cbe331d315)) - **REST:** Dynamic rate limit offsets ([#​10099](https://github.com/discordjs/discord.js/issues/10099)) ([278396e](https://github.com/discordjs/discord.js/commit/278396e815add4e028e43034fab586f971a043d4)) #### Refactor - Docs ([#​10126](https://github.com/discordjs/discord.js/issues/10126)) ([18cce83](https://github.com/discordjs/discord.js/commit/18cce83d80598c430218775c53441b6b2ecdc776)) - Use interfaces for AsyncEventEmitter event maps ([#​10044](https://github.com/discordjs/discord.js/issues/10044)) ([adfd9cd](https://github.com/discordjs/discord.js/commit/adfd9cd3b32cfabdcc45ec90f535b2852a3ca4a6)) #### Styling - Fix up lint ([d869d9b](https://github.com/discordjs/discord.js/commit/d869d9b3fecc3d89c051128380907e258a6a6c63)) #### Testing - Skip flaky rest test ([#​10234](https://github.com/discordjs/discord.js/issues/10234)) ([dc8f149](https://github.com/discordjs/discord.js/commit/dc8f14967c2c10b26c1be986d42e5d135675ad43))
--- ### Configuration ๐Ÿ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). ๐Ÿšฆ **Automerge**: Disabled by config. Please merge this manually once you are satisfied. โ™ป **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. ๐Ÿ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). Reviewed-on: https://git.vylpes.xyz/External/card-drop/pulls/232 Reviewed-by: Vylpes Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- package-lock.json | 61 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 48 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index bd065d7..368aee4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -748,10 +748,15 @@ } }, "node_modules/@discordjs/collection": { - "version": "2.0.0", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-2.1.0.tgz", + "integrity": "sha512-mLcTACtXUuVgutoznkh6hS3UFqYirDYAg5Dc1m8xn6OvPjetnUlf/xjtqnnc47OwWdaoCQnHmHh9KofhD6uRqw==", "license": "Apache-2.0", "engines": { "node": ">=18" + }, + "funding": { + "url": "https://github.com/discordjs/discord.js?sponsor" } }, "node_modules/@discordjs/formatters": { @@ -765,28 +770,54 @@ } }, "node_modules/@discordjs/rest": { - "version": "2.2.0", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-2.3.0.tgz", + "integrity": "sha512-C1kAJK8aSYRv3ZwMG8cvrrW4GN0g5eMdP8AuN8ODH5DyOCbHgJspze1my3xHOAgwLJdKUbWNVyAeJ9cEdduqIg==", "license": "Apache-2.0", "dependencies": { - "@discordjs/collection": "^2.0.0", - "@discordjs/util": "^1.0.2", - "@sapphire/async-queue": "^1.5.0", - "@sapphire/snowflake": "^3.5.1", - "@vladfrangu/async_event_emitter": "^2.2.2", - "discord-api-types": "0.37.61", - "magic-bytes.js": "^1.5.0", + "@discordjs/collection": "^2.1.0", + "@discordjs/util": "^1.1.0", + "@sapphire/async-queue": "^1.5.2", + "@sapphire/snowflake": "^3.5.3", + "@vladfrangu/async_event_emitter": "^2.2.4", + "discord-api-types": "0.37.83", + "magic-bytes.js": "^1.10.0", "tslib": "^2.6.2", - "undici": "5.27.2" + "undici": "6.13.0" }, "engines": { "node": ">=16.11.0" + }, + "funding": { + "url": "https://github.com/discordjs/discord.js?sponsor" } }, + "node_modules/@discordjs/rest/node_modules/@sapphire/snowflake": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.5.3.tgz", + "integrity": "sha512-jjmJywLAFoWeBi1W7994zZyiNWPIiqRRNAmSERxyg93xRGzNYvGjlZ0gR6x0F4gPRi2+0O6S71kOZYyr3cxaIQ==", + "license": "MIT", + "engines": { + "node": ">=v14.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@discordjs/rest/node_modules/discord-api-types": { + "version": "0.37.83", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.83.tgz", + "integrity": "sha512-urGGYeWtWNYMKnYlZnOnDHm8fVRffQs3U0SpE8RHeiuLKb/u92APS8HoQnPTFbnXmY1vVnXjXO4dOxcAn3J+DA==", + "license": "MIT" + }, "node_modules/@discordjs/util": { - "version": "1.0.2", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@discordjs/util/-/util-1.1.0.tgz", + "integrity": "sha512-IndcI5hzlNZ7GS96RV3Xw1R2kaDuXEp7tRIy/KlhidpN/BQ1qh1NZt3377dMLTa44xDUNKT7hnXkA/oUAzD/lg==", "license": "Apache-2.0", "engines": { "node": ">=16.11.0" + }, + "funding": { + "url": "https://github.com/discordjs/discord.js?sponsor" } }, "node_modules/@discordjs/ws": { @@ -1674,7 +1705,9 @@ } }, "node_modules/@sapphire/async-queue": { - "version": "1.5.0", + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.5.2.tgz", + "integrity": "sha512-7X7FFAA4DngXUl95+hYbUF19bp1LGiffjJtu7ygrZrbdCSsdDDBaSjB7Akw0ZbOu6k0xpXyljnJ6/RZUvLfRdg==", "license": "MIT", "engines": { "node": ">=v14.0.0", @@ -7725,7 +7758,9 @@ } }, "node_modules/magic-bytes.js": { - "version": "1.6.0", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/magic-bytes.js/-/magic-bytes.js-1.10.0.tgz", + "integrity": "sha512-/k20Lg2q8LE5xiaaSkMXk4sfvI+9EGEykFS4b0CHHGWqDYU0bGUFSwchNOMA56D7TCs9GwVTkqe9als1/ns8UQ==", "license": "MIT" }, "node_modules/make-dir": {