mirror of
https://github.com/BluemediaGER/muse.git
synced 2024-11-10 03:55:29 +01:00
Update invite permissions, send message to owner
This commit is contained in:
parent
fc5c1ee002
commit
d6c9d4b112
|
@ -7,6 +7,7 @@ import Command from './commands/index.js';
|
||||||
import debug from './utils/debug.js';
|
import debug from './utils/debug.js';
|
||||||
import handleGuildCreate from './events/guild-create.js';
|
import handleGuildCreate from './events/guild-create.js';
|
||||||
import handleVoiceStateUpdate from './events/voice-state-update.js';
|
import handleVoiceStateUpdate from './events/voice-state-update.js';
|
||||||
|
import handleGuildUpdate from './events/guild-update.js';
|
||||||
import errorMsg from './utils/error-msg.js';
|
import errorMsg from './utils/error-msg.js';
|
||||||
import {isUserInVoice} from './utils/channels.js';
|
import {isUserInVoice} from './utils/channels.js';
|
||||||
import Config from './services/config.js';
|
import Config from './services/config.js';
|
||||||
|
@ -14,7 +15,6 @@ import {generateDependencyReport} from '@discordjs/voice';
|
||||||
import {REST} from '@discordjs/rest';
|
import {REST} from '@discordjs/rest';
|
||||||
import {Routes} from 'discord-api-types/v9';
|
import {Routes} from 'discord-api-types/v9';
|
||||||
import updatePermissionsForGuild from './utils/update-permissions-for-guild.js';
|
import updatePermissionsForGuild from './utils/update-permissions-for-guild.js';
|
||||||
import handleGuildUpdate from './events/handle-guild-update.js';
|
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
export default class {
|
export default class {
|
||||||
|
@ -152,7 +152,7 @@ export default class {
|
||||||
spinner.text = '📡 updating permissions...';
|
spinner.text = '📡 updating permissions...';
|
||||||
await Promise.all(this.client.guilds.cache.map(async guild => updatePermissionsForGuild(guild)));
|
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);
|
this.client.on('error', console.error);
|
||||||
|
|
|
@ -32,4 +32,8 @@ export default async (guild: Guild): Promise<void> => {
|
||||||
{body: container.getAll<Command>(TYPES.Command).map(command => command.slashCommand.toJSON())},
|
{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.');
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue