add !members, fix typescript
This commit is contained in:
parent
1c94cf15b5
commit
1908a4f79e
3 changed files with 22 additions and 4 deletions
19
commands.ts
19
commands.ts
|
@ -80,9 +80,26 @@ We probably can't fully fix this. If you find out which mod is causing this, tel
|
|||
'!eta': async (c, e) => {
|
||||
await e.reply('Sometime');
|
||||
},
|
||||
|
||||
'!members': async (c, e) => {
|
||||
const mems = await e.guild?.members.fetch().then((r) => r.toJSON());
|
||||
if (!mems) return;
|
||||
|
||||
await e.reply({
|
||||
embeds: [
|
||||
{
|
||||
title: `${mems.length} total members!`,
|
||||
description: `${
|
||||
mems.filter((m) => m.presence?.status === 'online').length
|
||||
} online members`,
|
||||
color: 'GOLD',
|
||||
},
|
||||
],
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export const aliases = {
|
||||
export const aliases: { [a: string]: string } = {
|
||||
'!curse': '!cursed',
|
||||
'!curseforge': '!cursed',
|
||||
'!diff': '!why',
|
||||
|
|
6
index.ts
6
index.ts
|
@ -40,7 +40,7 @@ client.once('ready', async () => {
|
|||
BuildConfig.DEBUG_CHANNEL_ID
|
||||
);
|
||||
|
||||
if (!DEBUG_CHANNEL.isText()) throw new Error();
|
||||
if (!DEBUG_CHANNEL || !DEBUG_CHANNEL.isText()) throw new Error();
|
||||
DEBUG_CHANNEL.send({
|
||||
embeds: [
|
||||
{
|
||||
|
@ -84,10 +84,10 @@ client.once('ready', async () => {
|
|||
// }
|
||||
|
||||
{
|
||||
const urlMatches = e.content.matchAll(urlRegex());
|
||||
const urlMatches = [...e.content.matchAll(urlRegex())];
|
||||
|
||||
if (urlMatches) {
|
||||
console.log('Found links in message!');
|
||||
console.log('Found links in message from', e.author.tag);
|
||||
|
||||
for (const match of urlMatches) {
|
||||
console.log('[link]', match[0]);
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
"compilerOptions": {
|
||||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
"downlevelIteration": true,
|
||||
"target": "ES5"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue