start of a proper message event

This commit is contained in:
Lio Young 2021-04-08 02:43:47 +02:00
parent 293e27c110
commit 6aa23685a7
No known key found for this signature in database
GPG Key ID: 789795A11879E169
2 changed files with 58 additions and 0 deletions

34
src/content/status.json Normal file
View File

@ -0,0 +1,34 @@
[
{
"state": "server fans whirr",
"type": "LISTENING"
},
{
"state": "{GUILDAMOUNT} Servers",
"type": "LISTENING"
},
{
"state": "Portal",
"type": "PLAYING"
},
{
"state": "Portal 2",
"type": "LISTENING"
},
{
"state": "Half Life",
"type": "PLAYING"
},
{
"state": "Half Life 2",
"type": "LISTENING"
},
{
"state": "Skynet",
"type": "WATCHING"
},
{
"state": "Caecus",
"type": "LISTENING"
}
]

View File

@ -42,7 +42,31 @@ export = {
// ! Prefix
let PrefixArray: string[] = [...config.variables.prefix, [(server_data[0].prefix ? server_data[0].prefix : [])]].flat(Infinity)
let Prefix: string
let Exists: boolean
for (const p in PrefixArray) {
if (message.content.startsWith(PrefixArray[p])) {
Prefix = p
Exists = true
}
}
// ! If Prefix doesn't exist in Message Content, return
if (!Exists) return;
const args = message.content.slice(PrefixArray[Prefix].length).trim().split(/ +/g)
const command = args.shift()?.toLowerCase()
const cmd = client.commands.find((c) => (c.name as string).toLowerCase() == command || (c.aliases && c.aliases.includes(command)))
console.log(cmd)
if (!cmd) return;
if (!client.cooldowns.has(cmd.name)) {
client.cooldowns.set(cmd.name, new Collection())
}
const ctx = {
client, guild: message.guild, message, supabase, config, isDeveloper: config.developers.includes(message.author.id)
}
}
}