const prefix = "s!";
var dailyCheck = sql.get(`SELECT daily FROM scores WHERE userId = "${msg.author.id}"`);
bot.on("message", function (msg) {
if (msg.author.bot) return;
if (msg.content.toLowerCase = prefix + "dailies") {
var daily = dailies(msg);
daily; }
});
bot.on("message", function dailies(msg) {
reset.setInterval(function() {
var date = new Date();
if (date.getHours() === 15 && date.getMinutes() === 0) {
sql.run(`UPDATE scores SET daily = 0`);
}
}, 60000);
sql.run("CREATE TABLE IF NOT EXISTS scores (userId TEXT, daily INTEGER, glimmer INTEGER, wr INTEGER, rotw INTEGER)").then() => {
if (!row) {
// I get the error of unexpected token "." in the next line.
sql.run("CREATE TABLE IF NOT EXISTS scores (userId TEXT, points INTEGER, level INTEGER)").then() => {
sql.run("INSERT INTO scores (userId, daily, points, wr, rotw) VALUES (?, ?, ?, ?, ?)", [msg.author.id, 1, 200, 0, 0]);
msg.channel.send('Thank you for joining Playing Destiny Fast! You have 200 glimmer available!');
} else if (dailyCheck = 1) {
msg.channel.send('You have already accepted your daily rewards! Come back after the daily reset (9am PST) to claim again.');
} else {
sql.run(`UPDATE scores SET glimmer = ${row.glimmer + 200}, daily = 1, WHERE userId = ${msg.author.id}`);
msg.channel.send('${message.author.id} has claimed their 200 daily glimmer! Total: ${row.glimmer}');
}
});
});
具体的には、「予期しないトークン」を受け取っています。 sql.run(CREATE...
でエラーが発生しました。これを修正する方法を教えてください。予期しないトークンエラーを修正するにはどうすればよいですか?
今後タイトルにタグを追加しないでください。タグはタグフィールドに入ります。 – Daedalus