mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-04 22:16:08 +00:00
fix: check for ownerId in message commands
This commit is contained in:
parent
43cb84f54f
commit
75b6036888
@ -111,7 +111,11 @@ export async function onMessageCreate(
|
|||||||
if (command.defaultMemberPermissions && message.guildId) {
|
if (command.defaultMemberPermissions && message.guildId) {
|
||||||
const memberPermissions = await self.members.permissions(message.guildId, message.author.id);
|
const memberPermissions = await self.members.permissions(message.guildId, message.author.id);
|
||||||
const permissions = memberPermissions.missings(...memberPermissions.values([command.defaultMemberPermissions]));
|
const permissions = memberPermissions.missings(...memberPermissions.values([command.defaultMemberPermissions]));
|
||||||
if (!memberPermissions.has('Administrator') && permissions.length) {
|
if (
|
||||||
|
!memberPermissions.has('Administrator') &&
|
||||||
|
permissions.length &&
|
||||||
|
(await message.guild())!.ownerId !== message.author.id
|
||||||
|
) {
|
||||||
return command.onPermissionsFail?.(context, memberPermissions.keys(permissions));
|
return command.onPermissionsFail?.(context, memberPermissions.keys(permissions));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -248,7 +248,7 @@ class BaseCommand {
|
|||||||
name_localizations: this.name_localizations,
|
name_localizations: this.name_localizations,
|
||||||
description_localizations: this.description_localizations,
|
description_localizations: this.description_localizations,
|
||||||
guild_id: this.guildId,
|
guild_id: this.guildId,
|
||||||
default_member_permissions: this.defaultMemberPermissions ? this.defaultMemberPermissions.toString() : '',
|
default_member_permissions: this.defaultMemberPermissions ? this.defaultMemberPermissions.toString() : undefined,
|
||||||
contexts: this.contexts,
|
contexts: this.contexts,
|
||||||
integration_types: this.integrationTypes,
|
integration_types: this.integrationTypes,
|
||||||
} as {
|
} as {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user