From 2f9d80f430e72fcd0281e510a14e800f9efd12f9 Mon Sep 17 00:00:00 2001 From: Ethan Lane Date: Fri, 1 Mar 2024 20:02:11 +0000 Subject: [PATCH 1/4] Fix trade command (#177) # 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. - Fix the decline button not working for the initiating user - Update labels on embed to follow "I Receive" and "You Receive" #165 ## Type of change Please delete options that are not relevant. - [x] Bug fix (non-breaking change which fixes an issue) # 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://gitea.vylpes.xyz/External/card-drop/pulls/177 Reviewed-by: VylpesTester Co-authored-by: Ethan Lane Co-committed-by: Ethan Lane --- src/buttonEvents/Trade.ts | 18 +++++++++--------- src/commands/trade.ts | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/buttonEvents/Trade.ts b/src/buttonEvents/Trade.ts index 28b08ee..d272d9f 100644 --- a/src/buttonEvents/Trade.ts +++ b/src/buttonEvents/Trade.ts @@ -100,13 +100,13 @@ export default class Trade extends ButtonEvent { .setImage("https://i.imgur.com/9w5f1ls.gif") .addFields([ { - name: `${receiveUser.username} is giving`, - value: `${giveItem.id}: ${giveItem.name}`, + name: "I receieve", + value: `${receiveItem.id}: ${receiveItem.name}`, inline: true, }, { - name: `${giveUser.username} is giving`, - value: `${receiveItem.id}: ${receiveItem.name}`, + name: "You receieve", + value: `${giveItem.id}: ${giveItem.name}`, inline: true, }, { @@ -140,7 +140,7 @@ export default class Trade extends ButtonEvent { // No need to get expiry date const timeoutId = interaction.customId.split(" ")[7]; - if (interaction.user.id !== receiveUserId || interaction.user.id !== giveUserId) { + if (interaction.user.id != receiveUserId && interaction.user.id !==giveUserId) { await interaction.reply("You are not the user who the trade is intended for"); return; } @@ -170,13 +170,13 @@ export default class Trade extends ButtonEvent { .setImage("https://i.imgur.com/9w5f1ls.gif") .addFields([ { - name: `${receiveUser.username} is giving`, - value: `${giveItem.id}: ${giveItem.name}`, + name: "I Receive", + value: `${receiveItem.id}: ${receiveItem.name}`, inline: true, }, { - name: `${giveUser.username} is giving`, - value: `${receiveItem.id}: ${receiveItem.name}`, + name: "You Receive", + value: `${giveItem.id}: ${giveItem.name}`, inline: true, }, { diff --git a/src/commands/trade.ts b/src/commands/trade.ts index 60e78d8..8414ae9 100644 --- a/src/commands/trade.ts +++ b/src/commands/trade.ts @@ -63,19 +63,19 @@ export default class Trade extends Command { const expiry = now.setMinutes(now.getMinutes() + 15); const tradeEmbed = new EmbedBuilder() - .setTitle("Trade Offer") + .setTitle("⚠️ Trade Offer ⚠️") .setDescription(`Trade initiated between ${interaction.user.username} and ${user.username}`) .setColor(EmbedColours.Grey) .setImage("https://media1.tenor.com/m/KkZwKl2AQ2QAAAAd/trade-offer.gif") .addFields([ { - name: `${interaction.user.username} is giving`, - value: `${giveItem.id}: ${giveItem.name}`, + name: "I Receive", + value: `${receiveItem.id}: ${receiveItem.name}`, inline: true, }, { - name: `${user.username} is giving`, - value: `${receiveItem.id}: ${receiveItem.name}`, + name: "You Receive", + value: `${giveItem.id}: ${giveItem.name}`, inline: true, }, { @@ -109,13 +109,13 @@ export default class Trade extends Command { .setImage("https://media1.tenor.com/m/KkZwKl2AQ2QAAAAd/trade-offer.gif") .addFields([ { - name: `${receiveUsername} is giving`, - value: `${giveCardNumber}: ${giveCardName}`, + name: "I Receive", + value: `${receiveCardNumber}: ${receiveCardName}`, inline: true, }, { - name: `${giveUsername} is giving`, - value: `${receiveCardNumber}: ${receiveCardName}`, + name: "You Receive", + value: `${giveCardNumber}: ${giveCardName}`, inline: true, }, { From 42883c3a99df0cd340a92ee7d6216e40c96e6b2b Mon Sep 17 00:00:00 2001 From: Ethan Lane Date: Fri, 1 Mar 2024 20:03:34 +0000 Subject: [PATCH 2/4] Fix give command using the wrong username (#178) # 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. - Fix the give command incorrectly using the username of the user who used the command instead of the user who it was actually given to #174 ## Type of change Please delete options that are not relevant. - [x] Bug fix (non-breaking change which fixes an issue) # 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://gitea.vylpes.xyz/External/card-drop/pulls/178 Reviewed-by: VylpesTester Co-authored-by: Ethan Lane Co-committed-by: Ethan Lane --- src/commands/give.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/give.ts b/src/commands/give.ts index ad360a9..7bc24be 100644 --- a/src/commands/give.ts +++ b/src/commands/give.ts @@ -63,6 +63,6 @@ export default class Give extends Command { await inventory.Save(Inventory, inventory); - await interaction.reply(`${card.name} given to ${interaction.user}, they now have ${inventory.Quantity}`); + await interaction.reply(`${card.name} given to ${user.username}, they now have ${inventory.Quantity}`); } } \ No newline at end of file From 0c94c5817f518321b78b3fd1bde43a9c691f990a Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 5 Mar 2024 18:38:18 +0000 Subject: [PATCH 3/4] Update dependency @types/node to v20.11.24 (#179) 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.11.20` -> `20.11.24`](https://renovatebot.com/diffs/npm/@types%2fnode/20.11.20/20.11.24) | --- ### 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://gitea.vylpes.xyz/External/card-drop/pulls/179 Reviewed-by: Vylpes Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index ee09231..91e48a2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1881,9 +1881,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.11.20", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.20.tgz", - "integrity": "sha512-7/rR21OS+fq8IyHTgtLkDK949uzsa6n8BkziAKtPVpugIkO6D+/ooXMvzXxDnZrmtXVfjb1bKQafYpb8s89LOg==", + "version": "20.11.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.24.tgz", + "integrity": "sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long==", "dependencies": { "undici-types": "~5.26.4" } From 2377397a2e77f7f264a634dfed876aeb2873e9d1 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 5 Mar 2024 18:39:23 +0000 Subject: [PATCH 4/4] Update dependency express to v4.18.3 (#180) 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 | |---|---|---|---| | [express](http://expressjs.com/) ([source](https://github.com/expressjs/express)) | dependencies | patch | [`4.18.2` -> `4.18.3`](https://renovatebot.com/diffs/npm/express/4.18.2/4.18.3) | --- ### Release Notes
expressjs/express (express) ### [`v4.18.3`](https://github.com/expressjs/express/blob/HEAD/History.md#4183--2024-02-26) [Compare Source](https://github.com/expressjs/express/compare/4.18.2...4.18.3) \========== - Fix routing requests without method - deps: body-parser@1.20.2 - Fix strict json error message on Node.js 19+ - deps: content-type@~1.0.5 - deps: raw-body@2.5.2
--- ### 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://gitea.vylpes.xyz/External/card-drop/pulls/180 Co-authored-by: Renovate Bot Co-committed-by: Renovate Bot --- package-lock.json | 42 ++++-------------------------------------- 1 file changed, 4 insertions(+), 38 deletions(-) diff --git a/package-lock.json b/package-lock.json index 91e48a2..b7bee01 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4692,12 +4692,13 @@ } }, "node_modules/express": { - "version": "4.18.2", - "license": "MIT", + "version": "4.18.3", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.3.tgz", + "integrity": "sha512-6VyCijWQ+9O7WuVMTRBTl+cjNNIzD5cY5mQ1WM8r/LEkI2u8EYpOotESNwzNlyCn3g+dmjKYI6BmNneSr/FSRw==", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.1", + "body-parser": "1.20.2", "content-disposition": "0.5.4", "content-type": "~1.0.4", "cookie": "0.5.0", @@ -4731,41 +4732,6 @@ "node": ">= 0.10.0" } }, - "node_modules/express/node_modules/body-parser": { - "version": "1.20.1", - "license": "MIT", - "dependencies": { - "bytes": "3.1.2", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.11.0", - "raw-body": "2.5.1", - "type-is": "~1.6.18", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/express/node_modules/raw-body": { - "version": "2.5.1", - "license": "MIT", - "dependencies": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/external-editor": { "version": "3.1.0", "dev": true,