Merge branch 'feature/setverified' into 'master'
Add setverified command Closes #14 See merge request jdejeu/ottobotv2!3
This commit is contained in:
commit
6e5e6481c7
|
@ -0,0 +1,16 @@
|
||||||
|
package nl.voidcorp.discord.commands.management
|
||||||
|
|
||||||
|
import nl.voidcorp.discord.command.*
|
||||||
|
import nl.voidcorp.discord.storage.GuildStore
|
||||||
|
import org.springframework.stereotype.Service
|
||||||
|
|
||||||
|
@Service
|
||||||
|
class SetVerifiedCommand : Command("verify", location = CommandSource.GUILD, commandLevel = CommandLevel.ADMIN) {
|
||||||
|
override fun handle(event: CommandMessage): CommandResult {
|
||||||
|
val store = repo.findByGuildId(event.guild!!.idLong) ?: GuildStore(event.guild.idLong)
|
||||||
|
store.defaultVerified = !store.defaultVerified
|
||||||
|
repo.save(store)
|
||||||
|
event.reply("Set defaultverified to ${store.defaultVerified}!")
|
||||||
|
return CommandResult.SUCCESS
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue