aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Isom <[email protected]>2022-01-29 11:36:24 -0500
committerMax Isom <[email protected]>2022-01-29 11:36:24 -0500
commitd6c9d4b1128c5cddda74b3a84575388670edf221 (patch)
tree7f8bced758acb27c622253ac59c661ddba7542bf
parentfc5c1ee002260335971855eb31589d5aed25620a (diff)
downloadmuse-d6c9d4b1128c5cddda74b3a84575388670edf221.tar.xz
muse-d6c9d4b1128c5cddda74b3a84575388670edf221.zip
Update invite permissions, send message to owner
-rw-r--r--src/bot.ts4
-rw-r--r--src/events/guild-create.ts4
-rw-r--r--src/events/guild-update.ts (renamed from src/events/handle-guild-update.ts)0
3 files changed, 6 insertions, 2 deletions
diff --git a/src/bot.ts b/src/bot.ts
index 29cf818..0a041ec 100644
--- a/src/bot.ts
+++ b/src/bot.ts
@@ -7,6 +7,7 @@ import Command from './commands/index.js';
import debug from './utils/debug.js';
import handleGuildCreate from './events/guild-create.js';
import handleVoiceStateUpdate from './events/voice-state-update.js';
+import handleGuildUpdate from './events/guild-update.js';
import errorMsg from './utils/error-msg.js';
import {isUserInVoice} from './utils/channels.js';
import Config from './services/config.js';
@@ -14,7 +15,6 @@ import {generateDependencyReport} from '@discordjs/voice';
import {REST} from '@discordjs/rest';
import {Routes} from 'discord-api-types/v9';
import updatePermissionsForGuild from './utils/update-permissions-for-guild.js';
-import handleGuildUpdate from './events/handle-guild-update.js';
@injectable()
export default class {
@@ -152,7 +152,7 @@ export default class {
spinner.text = '📡 updating permissions...';
await Promise.all(this.client.guilds.cache.map(async guild => updatePermissionsForGuild(guild)));
- spinner.succeed(`Ready! Invite the bot with https://discordapp.com/oauth2/authorize?client_id=${this.client.user?.id ?? ''}&scope=bot%20applications.commands&permissions=2184236096`);
+ spinner.succeed(`Ready! Invite the bot with https://discordapp.com/oauth2/authorize?client_id=${this.client.user?.id ?? ''}&scope=bot%20applications.commands&permissions=36700160`);
});
this.client.on('error', console.error);
diff --git a/src/events/guild-create.ts b/src/events/guild-create.ts
index 8db7e2f..630d6cb 100644
--- a/src/events/guild-create.ts
+++ b/src/events/guild-create.ts
@@ -32,4 +32,8 @@ export default async (guild: Guild): Promise<void> => {
{body: container.getAll<Command>(TYPES.Command).map(command => command.slashCommand.toJSON())},
);
}
+
+ const owner = await guild.fetchOwner();
+
+ await owner.send('👋 Hi! Someone (probably you) just invited me to a server you own. I can\'t be used by your server members until you complete setup by running /config set-role in your server.');
};
diff --git a/src/events/handle-guild-update.ts b/src/events/guild-update.ts
index 837bbbe..837bbbe 100644
--- a/src/events/handle-guild-update.ts
+++ b/src/events/guild-update.ts