Skip to content
This repository was archived by the owner on Apr 23, 2025. It is now read-only.

Commit 75bb490

Browse files
author
andrewstech
committed
feat: Add domain extraction from input string in Owl.js
This commit updates the Owl.js file to extract the domain from the input string using a regular expression. It fixes a bug where the domain was not correctly identified. The extracted domain is then used for further processing in the code. Co-authored-by: FRED
1 parent 91f34ff commit 75bb490

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

events/buttons/Owl.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,19 @@ async function sendEmbed(interaction, description, color = "#0096ff", ephemeral
2626

2727
module.exports = async function (interaction) {
2828
await Loading(interaction, true);
29+
30+
// Get the domain from the input string
2931
const inputString = interaction.customId;
30-
const regex = /owl-(.*?)/;
32+
const regex = /^owl-(.*)$/;
33+
3134
const match = regex.exec(inputString);
3235

36+
const domain = match[1];
37+
3338
if (!match) {
3439
return sendEmbed(interaction, "Invalid domain identifier.", "#ff0000", true);
3540
}
3641

37-
const domain = match[1];
38-
console.log(domain);
3942

4043
const staffData = await staff.findOne({ _id: interaction.user.id });
4144
if (!staffData) {

0 commit comments

Comments
 (0)