Compare commits

..

No commits in common. "4b46d34f45d7685b3e201fd5df029b5a270764f3" and "c65e4031d9556841d8f14725b780c4a91aaca34b" have entirely different histories.

8 changed files with 16 additions and 25 deletions

View file

@ -29,7 +29,7 @@ plugins {
}
//lilJudd version 2
val creatorID = 372703841151614976L
val ownerID = 372703841151614976L
group = "net.moonleay.liljudd"
version = System.getenv("CI_COMMIT_TAG")?.let { "$it-${System.getenv("CI_COMMIT_SHORT_SHA")}-prod" }
?: System.getenv("CI_COMMIT_SHORT_SHA")?.let { "$it-dev" }
@ -120,7 +120,7 @@ val templateSrc = project.rootDir.resolve("src/main/templates")
val templateDest = project.projectDir.resolve("build/generated/templates")
val templateProps = mapOf(
"version" to project.version as String,
"creatorID" to creatorID,
"ownerID" to ownerID,
"kordversion" to kordver,
"coroutinesversion" to coroutinesver,
"ktorversion" to ktorver,

View file

@ -133,7 +133,7 @@ object Bot {
this.embed {
this.title = "Oops. Something went wrong."
this.description = "The bot encountered an error during execution.\n" +
"Please report this to <@${BuildConstants.creatorID}>.\n" +
"Please report this to <@${BuildConstants.ownerID}>.\n" +
"The errorid is \"$stamp.stk\""
this.field {
this.name = "Error message:"

View file

@ -31,7 +31,7 @@ suspend fun main() {
"v.${BuildConstants.version}\n"
)
Logger.out("li'l Judd made by moonleay (https://moonleay.net). Web UI made by aronmal (https://mal-noh.de).")
Logger.out("li'l Judd made by moonleay (https://moonleay.net). Web UI made by IchLiebeZuege (https://mal-noh.de).")
Logger.out("For more information check out https://liljudd.ink and https://git.moonleay.net/DiscordBots/lilJudd")
Bot.start()

View file

@ -44,7 +44,7 @@ object AvailabilityManager : IFeature {
// This runs during the cronjob.
suspend fun runThread() {
Logger.out("Updating match roles")
Logger.out("Starting to update roles...")
// ChannelID, Data
val messages = TimePlanningMessagesRepository.getWeek(TimeUtil.getWeekStamp().toEpochSecond())
@ -70,7 +70,7 @@ object AvailabilityManager : IFeature {
}
this.updateInChannel(snf, data, roleData)
}
Logger.out("Finished updating roles")
Logger.out("Done! Until tomorrow! <3 ")
}
suspend fun updateInChannel(snf: Snowflake) {
@ -162,7 +162,7 @@ object AvailabilityManager : IFeature {
// Register the cronjob to run at 1AM UTC every day
override suspend fun registerThread() {
Logger.out("Registering daily planning message role update coroutine")
Logger.out("Adding availability scheduler...")
val scheduler = buildSchedule("0 0 2 * * *") // 0 0 4 * * * 0o 1w // 0o is UTC
scheduler.doInfinity {
this.runThread()
@ -176,7 +176,7 @@ object AvailabilityManager : IFeature {
ch: Channel,
args: FeatureManageExtension.FeatureManagerArgs
): EmbedBuilder {
val alreadyExists = PlanningNotifierRolesRepository.existsInChannel(cID)
var alreadyExists = PlanningNotifierRolesRepository.existsInChannel(cID)
// Check if the channel and guild already exist in the db
if (!alreadyExists) {
// Create the roles in Discord

View file

@ -28,7 +28,7 @@ import net.moonleay.liljudd.util.Logger
object MatchManager {
suspend fun update() {
Logger.out("Updating matches")
Logger.out("Updating match roles...")
val dataList = MatchPlanningDataRepository.getAll()
for (data in dataList) {
@ -41,7 +41,7 @@ object MatchManager {
}
this.registerJob(data)
}
Logger.out("Finished updating matches")
Logger.out("Done. Until next time! <3 ")
}
private fun registerJob(data: MatchPlanningDataData) {

View file

@ -52,7 +52,7 @@ object TimeManager : IFeature {
// Register the cronjob to run at 0:01 AM UTC every Monday
override suspend fun registerThread() {
Logger.out("Registering weekly planning message posting coroutine")
Logger.out("Adding message scheduler...")
val scheduler = buildSchedule("0 0 1 * * * 0o 1w") // 0 0 4 * * * 0o 1w // 0o is UTC
scheduler.doInfinity {
this.runThread()
@ -60,7 +60,7 @@ object TimeManager : IFeature {
}
private suspend fun runThread() {
Logger.out("Starting to send out weekly planning messages")
Logger.out("Starting to notify...")
// ChannelID -> Data
val targetedChannels = TimePlanningChannelsRepository.getAll().associateBy { it.channelID }
@ -72,7 +72,7 @@ object TimeManager : IFeature {
for (ch2 in targetedChannels.keys) {
val ch = Snowflake(ch2)
if (Bot.bot.kordRef.getChannel(ch) == null)
continue
continue // TODO: Check if the channel is valid in another shard
val c = Bot.bot.kordRef.getChannelOf<MessageChannel>(ch)!!
msgStr = ""
if (targetedRoles != null && targetedRoles.keys.contains(ch2) && targetedRoles[ch2] != null) {
@ -133,7 +133,7 @@ object TimeManager : IFeature {
}
msgStr += "${it}:${msg.id.value};"
then = then.plusDays(1).withHour(4).withMinute(0).withSecond(0)
Logger.out("Finished sending day $it in $ch")
Logger.out("Finished sending day $it")
delay(1000)
}
@ -186,7 +186,7 @@ object TimeManager : IFeature {
): EmbedBuilder {
// Check if entry exists in db
if (TimePlanningChannelsRepository.exists(cID, gID)) {
// delete all entries for this channel
// delete all entrys for this channel
TimePlanningChannelsRepository.deleteFromChannelInServer(cID, gID)
return MessageUtil.getEmbed(
EmbedColor.SUCCESS,

View file

@ -37,11 +37,6 @@ object MessageUtil {
val ebb = EmbedBuilder()
ebb.color = e.color
ebb.title = e.title
ebb.author {
this.icon = e.author?.url
this.name = e.author?.name.toString()
this.url = e.author?.url
}
e.fields.forEach {
val fb = EmbedBuilder.Field()
fb.name = it.name
@ -49,10 +44,6 @@ object MessageUtil {
fb.inline = it.inline
ebb.fields.add(fb)
}
ebb.footer {
this.icon = e.footer?.iconUrl
this.text = e.footer?.text.toString()
}
ebb.description = e.description
return ebb
}

View file

@ -20,7 +20,7 @@ package net.moonleay.liljudd.build
internal object BuildConstants {
const val version = "${version}"
const val creatorID = "${creatorID}"
const val ownerID = "${ownerID}"
const val kordVersion = "${kordversion}"
const val coroutinesVersion = "${coroutinesversion}"
const val ktorVersion = "${ktorversion}"