remove the exclusive feature
This commit is contained in:
parent
3d552cddb5
commit
5e8f88b719
@ -4,6 +4,4 @@
|
||||
|
||||
Blanketbot is a Discord bot, coded to notify you when your favorite twitch streamer goes live. To simply set it up, add the Bot to your server through the Invite link above and use the `/streamer add` command to add your favorite streamer. The bot will then notify you when the streamer goes live.
|
||||
|
||||
This bot also includes a special feature for the discord of jansel, where you get timeouted when you write during german rest times (22:00 - 06:00, except weekends).
|
||||
|
||||
If issues arise, please don't hesitate to create an issue here on GitHub.
|
||||
|
@ -8,7 +8,6 @@ import com.github.twitch4j.TwitchClientBuilder
|
||||
import com.github.twitch4j.events.ChannelGoLiveEvent
|
||||
import dev.jansel.feixiao.database.collections.StreamerCollection
|
||||
import dev.jansel.feixiao.extensions.EventHooks
|
||||
import dev.jansel.feixiao.extensions.MessageEvents
|
||||
import dev.jansel.feixiao.extensions.StreamerCommand
|
||||
import dev.jansel.feixiao.utils.*
|
||||
import dev.kord.core.entity.channel.GuildMessageChannel
|
||||
@ -24,7 +23,6 @@ suspend fun main() {
|
||||
database(true)
|
||||
dataCollectionMode = DataCollection.None
|
||||
extensions {
|
||||
add(::MessageEvents)
|
||||
add(::EventHooks)
|
||||
add(::StreamerCommand)
|
||||
}
|
||||
|
@ -1,50 +0,0 @@
|
||||
package dev.jansel.feixiao.extensions
|
||||
|
||||
import dev.kord.common.entity.Permission
|
||||
import dev.kord.common.entity.Snowflake
|
||||
import dev.kord.core.event.message.MessageCreateEvent
|
||||
import dev.kordex.core.annotations.DoNotChain
|
||||
import dev.kordex.core.checks.anyGuild
|
||||
import dev.kordex.core.checks.inChannel
|
||||
import dev.kordex.core.checks.isNotBot
|
||||
import dev.kordex.core.checks.notHasPermission
|
||||
import dev.kordex.core.checks.notHasRole
|
||||
import dev.kordex.core.extensions.Extension
|
||||
import dev.kordex.core.extensions.event
|
||||
import dev.kordex.core.utils.timeout
|
||||
import java.util.*
|
||||
import kotlin.time.Duration.Companion.days
|
||||
|
||||
class MessageEvents : Extension() {
|
||||
override val name = "messageevents"
|
||||
|
||||
@OptIn(DoNotChain::class)
|
||||
override suspend fun setup() {
|
||||
event<MessageCreateEvent> {
|
||||
check {
|
||||
anyGuild()
|
||||
isNotBot()
|
||||
notHasPermission(Permission.ManageMessages)
|
||||
notHasRole(Snowflake(1130937397132152852))
|
||||
inChannel(Snowflake(1130942639764676709))
|
||||
}
|
||||
action {
|
||||
println("Message detected!")
|
||||
val calendar = Calendar.getInstance()
|
||||
calendar.timeZone = TimeZone.getTimeZone("Europe/Berlin")
|
||||
calendar.time = Date()
|
||||
val hour = calendar.get(Calendar.HOUR_OF_DAY)
|
||||
val day = calendar.get(Calendar.DAY_OF_WEEK)
|
||||
if ((day == Calendar.MONDAY && hour < 6) || (day == Calendar.MONDAY && hour >= 22) ||
|
||||
(day == Calendar.TUESDAY && hour < 6) || (day == Calendar.TUESDAY && hour >= 22) ||
|
||||
(day == Calendar.WEDNESDAY && hour < 6) || (day == Calendar.WEDNESDAY && hour >= 22) ||
|
||||
(day == Calendar.THURSDAY && hour < 6) || (day == Calendar.THURSDAY && hour >= 22) ||
|
||||
(day == Calendar.FRIDAY && hour < 6) || (day == Calendar.SUNDAY && hour >= 22)
|
||||
) {
|
||||
event.message.delete()
|
||||
event.member!!.timeout(7.days, "ES HERRSCHT RUHEZEIT!")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user