Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how can i get multiple arguments? #1247

Open
Lyraeonn opened this issue Jan 3, 2025 · 1 comment
Open

how can i get multiple arguments? #1247

Lyraeonn opened this issue Jan 3, 2025 · 1 comment

Comments

@Lyraeonn
Copy link

Lyraeonn commented Jan 3, 2025

Im trying to make a command that logs the user's text. Im not really good in explaining but here is my code.

bot.onText(/\/cml(\s.+)?/, (msg, args) => {
	const cid = msg.chat.id;
    let data = JSON.parse(fs.readFileSync('./replicated/user_data.json'));
    let index = data.findIndex(p => p.id === cid);
    if (index == -1) {
        bot.sendMessage(cid, `You are not verified yet. ID: ${cid}`)
        return
    } else {
        bot.sendMessage(cid, `1 : ${args[1]} 2: ${args[2]}`)
    }
});
@Lyraeonn
Copy link
Author

Lyraeonn commented Jan 3, 2025

Nevermind, i figured it out.

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

No branches or pull requests

1 participant