Skip to content

Commit

Permalink
feat: better perms for attendance
Browse files Browse the repository at this point in the history
  • Loading branch information
ToxicMushroom committed Apr 23, 2024
1 parent ee60958 commit 6734693
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion bot/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ val kotlinX = "1.7.3" // https://mvnrepository.com/artifact/org.jetbrains.kotlin
val kotlin = "1.9.21"
val scrimage = "4.1.0"

val jda = "5.0.0-beta.20"
val jda = "5.0.0-beta.23"
val kordEx = "1.6.8-SNAPSHOT"
val kordKommons = "0.0.13-SNAPSHOT"
val kandyVersion = "0.5.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,13 @@ class AttendanceExtension : Extension() {
name = "attendance"
description = "Manage attendance events"

requirePermission(Permission.ADMINISTRATOR)

requirePermission(Permission.MANAGE_EVENTS)

publicGuildSubCommand(::AttendanceCreateArgs) {
name = "create"
description = "Create a new attendance event"

requirePermission(Permission.ADMINISTRATOR)
requirePermission(Permission.CREATE_SCHEDULED_EVENTS)
noDefer()

action {
Expand Down Expand Up @@ -201,7 +200,7 @@ class AttendanceExtension : Extension() {
name = "edit"
description = "Edits an existing attendance event"

requirePermission(Permission.ADMINISTRATOR)
requirePermission(Permission.MANAGE_EVENTS)
noDefer()

action {
Expand Down Expand Up @@ -260,7 +259,7 @@ class AttendanceExtension : Extension() {
publicGuildSubCommand(::AttendanceRemoveArgs) {
name = "remove"
description = "Remove an attendance event"
requirePermission(Permission.ADMINISTRATOR)
requirePermission(Permission.MANAGE_EVENTS)

action {
val attendanceId = arguments.attendanceId
Expand All @@ -279,7 +278,6 @@ class AttendanceExtension : Extension() {
publicGuildSubCommand {
name = "list"
description = "List the attendance events"
requirePermission(Permission.ADMINISTRATOR)

action {
val attendanceEvents = attendanceManager.getByGuildKey(guild!!.idLong)
Expand Down Expand Up @@ -308,9 +306,6 @@ class AttendanceExtension : Extension() {
name = "info"
description = "Display all information of an attendance event"

requirePermission(Permission.ADMINISTRATOR)


action {
val data = this.arguments.attendanceData.await()
val jumpUrl = Helpers.format(
Expand Down

0 comments on commit 6734693

Please sign in to comment.