From 344751b9de0cc9fcd84c265b7e3866fdab825111 Mon Sep 17 00:00:00 2001 From: moonleay Date: Sun, 17 Sep 2023 12:59:54 +0200 Subject: [PATCH] fix: fixed removed functions Signed-off-by: moonleay --- .../moonleay/lilJudd/features/AvailabilityManager.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/net/moonleay/lilJudd/features/AvailabilityManager.kt b/src/main/kotlin/net/moonleay/lilJudd/features/AvailabilityManager.kt index 6a42046..df88ee1 100644 --- a/src/main/kotlin/net/moonleay/lilJudd/features/AvailabilityManager.kt +++ b/src/main/kotlin/net/moonleay/lilJudd/features/AvailabilityManager.kt @@ -95,7 +95,7 @@ object AvailabilityManager : IFeature { val weekday = ZonedDateTime.now().dayOfWeek // The current week day val weekStamp = TimeUtil.getWeekStamp().toEpochSecond() * 1000 // The current week time stamp Logger.out("It is week ${weekStamp} and day ${weekday}/${TimeUtil.getDayOfMonthInt(weekday)} of the week.") - val g = Bot.bot.kordRef.getGuildOrThrow(Snowflake(tpmd.serverID)) + val g = Bot.bot.kordRef.getGuild(Snowflake(tpmd.serverID)) // Get all members with the role val mce = g.requestMembers { this.requestAllMembers() @@ -139,7 +139,7 @@ object AvailabilityManager : IFeature { .getMemberOrNull(Snowflake(tid)) == null ) continue// This member does not exist anymore. - val member = Bot.bot.kordRef.getGuildOrThrow(Snowflake(tpmd.serverID)) + val member = Bot.bot.kordRef.getGuild(Snowflake(tpmd.serverID)) .getMember(Snowflake(tid)) // Get the member if (member.roleIds.contains(Snowflake(pnrd.hasTimeRoleID))) continue // This member already has the role @@ -175,13 +175,13 @@ object AvailabilityManager : IFeature { // Check if the channel and guild already exist in the db if (!alreadyExists) { // Create the roles in Discord - val hasTimeRole = Bot.bot.kordRef.getGuildOrThrow(Snowflake(gID)).createRole { + val hasTimeRole = Bot.bot.kordRef.getGuild(Snowflake(gID)).createRole { this.name = "available [${ch.data.name.value}]" this.mentionable = true } val htr = hasTimeRole.id.value.toLong() - val wantsNotifsRole = Bot.bot.kordRef.getGuildOrThrow(Snowflake(gID)).createRole { + val wantsNotifsRole = Bot.bot.kordRef.getGuild(Snowflake(gID)).createRole { this.name = "notifications [${ch.data.name.value}]" this.mentionable = true } @@ -226,9 +226,9 @@ object AvailabilityManager : IFeature { if (PlanningNotifierRolesRepository.existsInChannelFromSever(cID, gID)) { val entry = PlanningNotifierRolesRepository.getForChannelInServer(cID, gID)!! // delete all entries for this guild and channel combo - Bot.bot.kordRef.getGuildOrThrow(Snowflake(gID)) + Bot.bot.kordRef.getGuild(Snowflake(gID)) .getRoleOrNull(Snowflake(entry.hasTimeRoleID))?.delete() - Bot.bot.kordRef.getGuildOrThrow(Snowflake(gID)) + Bot.bot.kordRef.getGuild(Snowflake(gID)) .getRoleOrNull(Snowflake(entry.wantsToBeNotifiedID))?.delete() // delete all found entries