Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/main/kotlin/org/hyacinthbots/lilybot/extensions/moderation/events/ModerationEvents.kt
#	src/main/kotlin/org/hyacinthbots/lilybot/extensions/utility/events/UtilityEvents.kt
  • Loading branch information
NoComment1105 committed Sep 22, 2024
2 parents 1fd8256 + 7a3f495 commit c593cde
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,18 @@ class ModerationEvents : Extension() {
}
}
} else {
// FIXME I'm gonna be sick please fix this
if (event.member.nickname == event.old?.nickname &&
event.member.roleBehaviors == event.old?.roleBehaviors &&
(
event.member.data != event.old?.data || event.member.avatar != event.old?.avatar ||
event.member.premiumSince != event.old?.premiumSince ||
event.member.isPending != event.old?.isPending || event.member.flags != event.old?.flags ||
event.member.avatarDecoration != event.old?.avatarDecoration
)
) {
return@action
}
val newRoles = mutableListOf<String>()
val oldRoles = mutableListOf<String>()
event.member.roleBehaviors.forEach { newRoles.add(it.mention) }
Expand All @@ -278,12 +290,7 @@ class ModerationEvents : Extension() {
value = "Old: ${event.old?.nickname}\nNew: ${event.member.nickname}"
}
}
if (event.member.isOwner() != event.old?.isOwner()) {
field {
name = "Became server owner"
}
}
if (event.member.roles != event.old?.roles) {
if (event.member.roleBehaviors != event.old?.roleBehaviors) {
field {
name = "New Roles"
value = newRoles.joinToString(", ")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,19 @@ class UtilityEvents : Extension() {
action {
// Do not log if role updates are disabled
if (UtilityConfigCollection().getConfig(event.guildId)?.logRoleUpdates == false) return@action
// FIXME this sucks how can i make it not suck
@Suppress("ComplexCondition") // Am i surprised? no.
if (event.old?.name == event.role.name && event.old?.hoisted == event.role.hoisted &&
event.old?.mentionable == event.role.mentionable && event.old?.getPosition() == event.role.getPosition() &&
event.old?.icon == event.role.icon && event.old?.unicodeEmoji == event.role.unicodeEmoji &&
event.old?.permissions == event.role.permissions && event.old?.color == event.role.color &&
(
event.old?.managed != event.role.managed || event.old?.tags != event.role.tags ||
event.old?.flags != event.role.flags
)
) {
return@action
}
val guild = GuildBehavior(event.guildId, kord)
val channel = getLoggingChannelWithPerms(ConfigOptions.UTILITY_LOG, guild)
channel?.createMessage {
Expand Down

0 comments on commit c593cde

Please sign in to comment.