Skip to content

fix: set welcome/bye variable inconsistency and placeholder docs#24

Merged
znanx merged 1 commit intoznanx:masterfrom
Kiznaiverr:moon
Feb 12, 2026
Merged

fix: set welcome/bye variable inconsistency and placeholder docs#24
znanx merged 1 commit intoznanx:masterfrom
Kiznaiverr:moon

Conversation

@Kiznaiverr
Copy link
Contributor

Changes Made

  • Variable Standardization: Updated settext.js to use consistent variable names (sWelcometext_welcome, sByetext_left) to match the keys used in listeners.js and models.js.

  • Documentation Fix: Corrected placeholder examples in help messages from @tag/+tag to @user for accurate usage guidance. This aligns with the replacement logic in listeners.js:

    const txt = (groupSet && groupSet.text_welcome ? groupSet.text_welcome : text)
      .replace("@user", `@${x.member.split`@`[0]}`)
      .replace("@subject", x.subject || "")
      .replace("@desc", x.groupMetadata.desc || "");

Issue Resolved

  • Custom welcome/bye messages now work properly (previously, set text was ignored due to mismatched variable names).
  • Users can now use placeholders like @user, @subject, @desc without confusion.

Copilot AI review requested due to automatic review settings February 12, 2026 10:56
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to fix custom welcome/bye text configuration by aligning the stored group settings keys with the keys actually read by the group participant listeners, and to correct placeholder documentation shown to admins when using the commands.

Changes:

  • Update setwelcome/setbye setters to write groupSet.text_welcome and groupSet.text_left.
  • Fix help/usage strings to reference @user (instead of @tag/+tag) in placeholder examples.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

if (!text) return conn.reply(m.chat, formatWel(usedPrefix, command), m);
groupSet.text_welcome = text;
await conn.reply(m.chat, Func.texted("bold", `🚩 Successfully set.`), m);
} else if (/set(out|left)/i.test(command)) {
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

help lists setbye, but the handler branch for setting the left/bye text only matches /set(out|left)/i. As a result, invoking setbye won’t set groupSet.text_left (no branch runs). Update the condition to explicitly handle setbye (or change help to match the supported command names) so the command actually works.

Suggested change
} else if (/set(out|left)/i.test(command)) {
} else if (command === "setbye" || /set(out|left)/i.test(command)) {

Copilot uses AI. Check for mistakes.

• *Example* : ${prefix + command} Good by +tag`
} No newline at end of file
• *Example* : ${prefix + command} Good by @user`;
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

User-facing example has a typo: “Good by”. Consider changing it to “Goodbye” (or “Good bye”) for correct wording.

Suggested change
*Example* : ${prefix + command} Good by @user`;
*Example* : ${prefix + command} Goodbye @user`;

Copilot uses AI. Check for mistakes.
Comment on lines +2 to +19
help: ["setwelcome", "setbye"],
use: "text",
tags: "admin",
run: async (m, { conn, usedPrefix, command, text, groupSet, Func }) => {
if (command == "setwelcome") {
if (!text) return conn.reply(m.chat, formatWel(usedPrefix, command), m);
groupSet.text_welcome = text;
await conn.reply(m.chat, Func.texted("bold", `🚩 Successfully set.`), m);
} else if (/set(out|left)/i.test(command)) {
if (!text) return conn.reply(m.chat, formatLef(usedPrefix, command), m);
groupSet.text_left = text;
await conn.reply(m.chat, Func.texted("bold", `🚩 Successfully set.`), m);
}
},
group: true,
admin: true,
error: false,
};
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file switches to double quotes + semicolons, while other plugins in this repo consistently use single quotes and omit semicolons (e.g. plugins/admin/action.js, plugins/admin/groupset.js). Consider aligning formatting here to match the established plugin style to reduce inconsistency/churn.

Copilot uses AI. Check for mistakes.
@znanx znanx merged commit 1167ee4 into znanx:master Feb 12, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants