Update invite permissions, send message to owner

This commit is contained in:
Max Isom 2022-01-29 11:36:24 -05:00
parent fc5c1ee002
commit d6c9d4b112
No known key found for this signature in database
GPG key ID: 25C9B1A7F6798880
3 changed files with 6 additions and 2 deletions

View file

@ -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);

View file

@ -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.');
};