make del trigger a bit more idiotensicher
This commit is contained in:
parent
8545576415
commit
aeae405f64
|
@ -10,7 +10,7 @@ module.exports = (lib) => {
|
||||||
var ids = e.message.split(' ');
|
var ids = e.message.split(' ');
|
||||||
ids.shift();
|
ids.shift();
|
||||||
ids.forEach(id => {
|
ids.forEach(id => {
|
||||||
if(Number.isInteger(parseInt(id))) {
|
if(Number.isInteger(parseInt(id)) && parseInt(id) > 0) {
|
||||||
lib.sql.query("select `dest` from `f0ck`.`items` where `id` = ? limit 1", id, (err, rows) => {
|
lib.sql.query("select `dest` from `f0ck`.`items` where `id` = ? limit 1", id, (err, rows) => {
|
||||||
if(rows[0]) {
|
if(rows[0]) {
|
||||||
lib.sql.query("delete from `f0ck`.`items` where `id` = ? limit 1", id, err => {
|
lib.sql.query("delete from `f0ck`.`items` where `id` = ? limit 1", id, err => {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user