From abc5468bc4bc4b5ae38728df7945bcbb77c6df82 Mon Sep 17 00:00:00 2001 From: aphased <152172867+aphased@users.noreply.github.com> Date: Sat, 8 Feb 2025 16:16:36 +0100 Subject: [PATCH 1/2] Add bingo party join command alias(es) --- commands/joinParty.js | 10 ++++++++++ settings.js | 10 ++++++++++ 2 files changed, 20 insertions(+) create mode 100644 commands/joinParty.js diff --git a/commands/joinParty.js b/commands/joinParty.js new file mode 100644 index 0000000..91b175c --- /dev/null +++ b/commands/joinParty.js @@ -0,0 +1,10 @@ +import settings from "../settings"; +import constants from "../utils/constants"; +import Party from "../utils/Party" + +register("command", () => { + ChatLib.chat(`${constants.PREFIX}&aJoining Bingo party.`); + ChatLib.command(`p join ${Party.getBotIGN()}`); +}) + .setCommandName("pb") + .setAliases(settings().partyJoinAlias); diff --git a/settings.js b/settings.js index 17c35bd..9f3e666 100644 --- a/settings.js +++ b/settings.js @@ -715,6 +715,16 @@ const config = new DefaultConfig("BingoPlus", "data/settings.json") subcategory: "" }) +.addTextInput({ + category: "Commands", + configName: "partyJoinAlias", + title: "Bingo Party Join Alias", + description: "Runs &e/p join IGN&r using the bot IGN defined earlier.\nDefault command alias is &e/pb&r, you can define additional aliases below.", + value: "pjoinbp", + placeHolder: "pb", + subcategory: "" +}) + // Dev .addTextParagraph({ From 33580de1ad89d54b24b6136d4aef760ddb25a1b2 Mon Sep 17 00:00:00 2001 From: aphased <152172867+aphased@users.noreply.github.com> Date: Sat, 8 Feb 2025 16:25:59 +0100 Subject: [PATCH 2/2] Use `ChatLib.command` over `say` with a slash (As seen in basically all other uses in the repo) (configuring git to not stage the newline at the end of files which my editor adds upon saving was a challenge, but not possible for `centuryCakeIsland.js`) --- commands/centuryCakeIsland.js | 4 ++-- features/bingo/achievements.js | 4 ++-- features/party/bingoPartyCommandConverter.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/commands/centuryCakeIsland.js b/commands/centuryCakeIsland.js index 331c416..f9eefdf 100644 --- a/commands/centuryCakeIsland.js +++ b/commands/centuryCakeIsland.js @@ -9,5 +9,5 @@ register("command", () => { ChatLib.chat(`${constants.PREFIX}&aDefaulting to BingoSplasher.`) name = "BingoSplasher" } - ChatLib.say(`/visit ${name}`) -}).setCommandName("cake").setAliases("cakes") \ No newline at end of file + ChatLib.command(`visit ${name}`) +}).setCommandName("cake").setAliases("cakes") diff --git a/features/bingo/achievements.js b/features/bingo/achievements.js index 870ce93..e77d0b2 100644 --- a/features/bingo/achievements.js +++ b/features/bingo/achievements.js @@ -13,8 +13,8 @@ register("chat", (event) => { ChatLib.chat(`${constants.PREFIX}&aAchievement copied to clipboard!`) } if (settings().autoSendAchievementsInParty) { - if (Party.inParty) ChatLib.say(`/pc ${event}`) + if (Party.inParty) ChatLib.command(`pc ${event}`) } - if (settings().autoSendAchievementsInGuild) ChatLib.say(`/gc ${event}`) + if (settings().autoSendAchievementsInGuild) ChatLib.command(`gc ${event}`) }).setCriteria(regex) \ No newline at end of file diff --git a/features/party/bingoPartyCommandConverter.js b/features/party/bingoPartyCommandConverter.js index 95ee622..d1f78a2 100644 --- a/features/party/bingoPartyCommandConverter.js +++ b/features/party/bingoPartyCommandConverter.js @@ -97,8 +97,8 @@ register("messageSent", (message, event) => { // check if a random string should be added let newMessage = args.slice(1).join(' ') // the slice removes /p if (settings().bingoPartyCommandRandomString) newMessage = Party.addRandomString(newMessage) - const command = `/msg ${Party.getBotIGN()} !p ${newMessage}` + const command = `msg ${Party.getBotIGN()} !p ${newMessage}` cancel(event) - ChatLib.say(command) + ChatLib.command(command) })