mirror of
https://github.com/thaldrin/thaldrin.git
synced 2024-08-14 23:57:21 +00:00
start of a proper message event
This commit is contained in:
parent
293e27c110
commit
6aa23685a7
2 changed files with 58 additions and 0 deletions
34
src/content/status.json
Normal file
34
src/content/status.json
Normal 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"
|
||||||
|
}
|
||||||
|
]
|
|
@ -42,7 +42,31 @@ export = {
|
||||||
// ! Prefix
|
// ! Prefix
|
||||||
let PrefixArray: string[] = [...config.variables.prefix, [(server_data[0].prefix ? server_data[0].prefix : [])]].flat(Infinity)
|
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)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue