rewrited
This commit is contained in:
parent
b0262c9a98
commit
d6e8274356
14
index.js
14
index.js
@ -22,10 +22,11 @@ client.login(config.token).catch((err) => console.log('Invalid Token'))
|
||||
client.on('guildDelete', async(guild) => {
|
||||
banned.exec(`CREATE TABLE IF NOT EXISTS banned (
|
||||
name TEXT NOT NULL,
|
||||
id INT NOT NULL
|
||||
id INT NOT NULL,
|
||||
timestamp TEXT NOT NULL
|
||||
)`)
|
||||
banned.exec(`INSERT INTO banned VALUES ('${guild.name}', '${guild.id}')`)
|
||||
})
|
||||
banned.exec(`INSERT INTO banned VALUES ('${guild.name}', '${guild.id}', '${new Date()}')`)
|
||||
})
|
||||
client.on('message', async(message) => {
|
||||
if (message.content.includes("'")) var cleanmessage = message.content.replace(/'/g, "\\'")
|
||||
else var cleanmessage = message.content
|
||||
@ -42,16 +43,17 @@ client.on('message', async(message) => {
|
||||
user_id INT NOT NULL,
|
||||
group_id INT NOT NULL
|
||||
)`)
|
||||
group.exec(`INSERT INTO ${grp} VALUES ('${cleanmessage}', '${message.id}', '${message.author.username}', '${message.author.id}', '${message.channel.id}')`)
|
||||
group.exec(`INSERT INTO ${grp} VALUES ('${cleanmessage}', '${message.id}', '${message.createdAt}', '${message.author.username}', '${message.author.id}', '${message.channel.id}')`)
|
||||
break;
|
||||
case "dm":
|
||||
var auth = `${message.author.username.split(' ').join('_')}`
|
||||
private.exec(`CREATE TABLE IF NOT EXISTS ${auth} (
|
||||
message TEXT NOT NULL,
|
||||
msg_id TEXT NOT NULL,
|
||||
user_id INT NOT NULL
|
||||
user_id INT NOT NULL,
|
||||
timestamp TEXT NOT NULL
|
||||
)`)
|
||||
private.exec(`INSERT INTO ${auth} VALUES ('${cleanmessage}', '${message.id}', '${message.author.id}')`)
|
||||
private.exec(`INSERT INTO ${auth} VALUES ('${cleanmessage}', '${message.id}', '${message.author.id}', '${message.createdAt}')`)
|
||||
break;
|
||||
}
|
||||
})
|
Loading…
Reference in New Issue
Block a user