ERRORS BEGONE
This commit is contained in:
parent
fc9a0dc33c
commit
7a6a74d161
4 changed files with 12 additions and 12 deletions
|
@ -10,7 +10,7 @@ module.exports = class {
|
|||
async run (message) {
|
||||
if (message.author.bot) return;
|
||||
|
||||
let data = {};
|
||||
const data = {};
|
||||
data.user = await this.client.db.getUser(message.author.id);
|
||||
|
||||
const prefixes = [data.user.prefix];
|
||||
|
|
|
@ -11,24 +11,24 @@ class Database {
|
|||
}
|
||||
|
||||
async getGuild (id) {
|
||||
let res = await this.pool.query('SELECT * FROM guilds WHERE guild_id = $1;', [id]);
|
||||
const res = await this.pool.query('SELECT * FROM guilds WHERE guild_id = $1;', [id]);
|
||||
return res.rows[0];
|
||||
}
|
||||
|
||||
async getMember (guild_id, user_id) {
|
||||
const key = guild_id + ':' + user_id;
|
||||
let res = await this.pool.query('SELECT * FROM members WHERE member_id = $1;', [key]);
|
||||
const res = await this.pool.query('SELECT * FROM members WHERE member_id = $1;', [key]);
|
||||
return res.rows[0];
|
||||
}
|
||||
|
||||
async getUser (id) {
|
||||
let res = await this.pool.query('SELECT * FROM guilds WHERE user_id = $1;', [id]);
|
||||
const res = await this.pool.query('SELECT * FROM guilds WHERE user_id = $1;', [id]);
|
||||
return res.rows[0];
|
||||
}
|
||||
|
||||
async updateGuild (id, column, newValue) {
|
||||
const sql = format('UPDATE guilds SET %I = $1 WHERE guild_id = $2;', column);
|
||||
let res = await this.pool.query(sql, [newValue, id]);
|
||||
const res = await this.pool.query(sql, [newValue, id]);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ class Functions {
|
|||
}
|
||||
|
||||
async getLastMessage (channel) {
|
||||
let messages = await channel.messages.fetch({ limit: 2 });
|
||||
const messages = await channel.messages.fetch({ limit: 2 });
|
||||
return messages.last().content;
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ class Functions {
|
|||
searchForMembers (guild, query) {
|
||||
query = query.toLowerCase();
|
||||
|
||||
let matches = [];
|
||||
const matches = [];
|
||||
let match;
|
||||
|
||||
try {
|
||||
|
|
Loading…
Reference in a new issue