Build an auto-responder with an editable list of trigger/reply rules in settings, four ready-to-use defaults including "it is broken", and at most one reply per message
Replies when a message contains a configured trigger. Four ready-to-use rules are included, including the classic “it is broken” reply. Add, edit, reorder or remove rules in Setup. Only the first matching rule replies; an empty list disables replies.
Made by MEE6. Remix it to get a copy of your own and change anything you like.
Have you tried turning it off and on again?
You’re welcome! Glad the community could help 💙
Hello! Welcome to the conversation 👋
// Ready-to-use replies; admins can add, remove or edit rules in Setup.
mee6.settings({
rules: {
type: 'list',
label: 'Auto-responses',
maxItems: 25,
fields: {
trigger: { type: 'string', label: 'Message contains', required: true },
response: { type: 'string', label: 'Reply', required: true },
},
default: [
{ trigger: 'it is broken', response: 'Have you tried turning it off and on again?' },
{ trigger: 'hello everyone', response: 'Hello! Welcome to the conversation 👋' },
{ trigger: 'where are the rules', response: 'Check the server’s rules channel before posting.' },
{ trigger: 'thanks for the help', response: 'You’re welcome! Glad the community could help 💙' },
],
},
});
// Only a message containing one of the triggers wakes the module; the handler
// still looks up which rule it was.
mee6.on('message', { contains: mee6.setting('rules', 'trigger') }, async (ctx) => {
const rules = (ctx.settings.rules ?? []) as { trigger: string; response: string }[];
const content = ctx.message.content.toLowerCase();
const rule = rules.find((rule) => rule.trigger?.trim() && content.includes(rule.trigger.toLowerCase()));
if (rule?.response) await ctx.reply(rule.response);
});