mirror of
https://github.com/chenasraf/venom.git
synced 2026-05-18 01:29:07 +00:00
fix: lock brain save to admins
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
} from '@/core/megahal'
|
||||
import { CHAT_TRIGGERS, DEFAULT_COMMAND_PREFIX } from '@/env'
|
||||
import { isWhitelisted, manipulateWhitelist } from '@/lib/blacklist'
|
||||
import { isAdministrator } from '@/utils/discord_utils'
|
||||
|
||||
export default command({
|
||||
command: 'chat',
|
||||
@@ -53,6 +54,11 @@ export default command({
|
||||
message.reply('I am now unmuted')
|
||||
break
|
||||
case 'save': {
|
||||
const isAdmin = await isAdministrator(message.member!)
|
||||
if (!isAdmin) {
|
||||
message.reply('You are not allowed to do that!')
|
||||
break
|
||||
}
|
||||
const success = await saveBrain()
|
||||
if (success) {
|
||||
const size = await getMegahalBrainSize('string')
|
||||
|
||||
Reference in New Issue
Block a user