【发布时间】:2020-08-29 17:24:40
【问题描述】:
我想向不和谐 id(VERIFICATIONLINK) 发送消息,我知道如何发送带有 id 的消息,但我想知道如何循环遍历每个具有 'VERIFIED'=InProgress 的条目,获取该条目中要在 foreach 循环中使用的其他值。
图片是mysql表现在的样子enter image description here
下面的代码是我现在连接到mysql部分的代码
host: config.mysqlhost,
port: config.mysqlport,
user: config.mysqluser,
password: config.mysqlpassword,
database: config.mysqldatabase,
})
connection.connect(err => {
if(err) throw err;
console.log("Connected to db")
})
client.connection = connection;
function continueVerification(){
let Playervals = connection.query("SELECT * FROM " + config.mysqltable + " WHERE VERIFIED='InProgress'", console.log);
//take that above info and loop into foreach
//in the foreach, I will send a message to each entry via the 'LINKVERIFICATION' entry which is their discordID
}```
【问题讨论】:
标签: mysql node.js discord discord.js