Do some more tests

This commit is contained in:
Helloyunho 2021-03-20 00:48:24 +09:00
parent 07dae683dc
commit f3115af2b9

View file

@ -15,6 +15,7 @@ import {
} from '../../mod.ts'
import { Collector } from '../models/collectors.ts'
import { MessageAttachment } from '../structures/message.ts'
import { OverrideType } from '../types/channel.ts'
import { TOKEN } from './config.ts'
const client = new Client({
@ -233,6 +234,23 @@ client.on('messageCreate', async (msg: Message) => {
})
msg.channel.send(`Done!`)
}
} else if (msg.content === '!updateBasicOverwrites') {
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
if (!checkGuildTextBasedChannel(msg.channel)) {
return msg.channel.send("This isn't a guild text channel!")
}
if (msg.member !== undefined) {
await msg.channel.editOverwrite(
{
id: msg.member,
allow: Permissions.DEFAULT.toString()
},
{
overriteAllow: OverrideType.REMOVE
}
)
msg.channel.send(`Done!`)
}
} else if (msg.content === '!addAllRoles') {
const roles = await msg.guild?.roles.array()
if (roles !== undefined) {