mirror of
https://github.com/MrUnknownDE/UnknownAI.git
synced 2026-04-19 06:23:45 +02:00
okey.
This commit is contained in:
43
events/guild/message.js
Normal file
43
events/guild/message.js
Normal file
@@ -0,0 +1,43 @@
|
||||
const config = require('../../configs/config.json');
|
||||
const Discord = require('discord.js');
|
||||
const db = require('quick.db');
|
||||
const chalk = require('chalk');
|
||||
|
||||
module.exports = async (client, message) => {
|
||||
let prefix = config.prefix
|
||||
try{
|
||||
if (message.author.bot || message.channel.type === "dm") return;
|
||||
|
||||
if((message.content === "<@155076323612688384>") || (message.content === "<@!155076323612688384>")){
|
||||
message.channel.send(`My Prefix is ${config.prefix}`)
|
||||
}
|
||||
|
||||
if(!message.content.startsWith(prefix)) return;
|
||||
|
||||
|
||||
let timeout = 60 * 1000
|
||||
|
||||
let myDaily = await db.get(`timeout`)
|
||||
|
||||
if(!db.has(`${message.guild.id}.${message.author.id}.messageCount`)) {
|
||||
db.set(`${message.guild.id}.${message.author.id}.messageCount`, 1)
|
||||
} else {
|
||||
db.add(`${message.guild.id}.${message.author.id}.messageCount`, 1)
|
||||
}
|
||||
|
||||
let args = message.content.slice(prefix.length).trim().split(/ +/g);
|
||||
const cmd = args.shift().toLowerCase();
|
||||
|
||||
var commandfile = client.commands.get(cmd) || client.commands.get(client.aliases.get(cmd))
|
||||
if (commandfile) commandfile.run(client, message, args);
|
||||
|
||||
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user