Answer the question
In order to leave comments, you need to log in
Why is args not defined?
Doesn't read args.
const SECRET_KEY = '**';
const QiwiBillPaymentsAPI = require('@qiwi/bill-payments-node-js-sdk');
const qiwiApi = new QiwiBillPaymentsAPI(SECRET_KEY);
const publicKey = '**';
module.exports = {
run: async (client, message, args) => {
const billId = args[0]
const nick = message.content.split(" ").splice(2).join(" ")
if (!billId) return message.channel.send("Вы не указали свой платежный ID!")
if (!nick) return message.channel.send("Вы не указали свой платежный ID!")
qiwiApi.getBillInfo(billId).then( data => {
if(data.status.value = "PAID") return message.author.send("Успешно оплачено!")
if(data.status.value = "WAITING") return message.author.send("Ваш счет ожидает оплаты!")
}
)}}
module.exports.help = {
name: "статус"
}
Answer the question
In order to leave comments, you need to log in
Here is a proven regular
expression ([a-zA-Z]+[a-zA-Z-']*)+
You can optimize it if necessary. This screen was made with PhpStorm, there is an opportunity to use a regular expression in the search / replacement, it always helps me. What is highlighted are those values that fall under the regular expression
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question