mirror of
https://github.com/devproje/px32-bot.git
synced 2024-11-26 10:43:05 +00:00
feat: avatar command image size
This commit is contained in:
parent
3f681bab4e
commit
49afa9f2a6
15 changed files with 83 additions and 56 deletions
|
@ -1,9 +1,5 @@
|
||||||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
|
||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
kotlin("jvm") version "2.0.20"
|
kotlin("jvm") version "2.0.20"
|
||||||
id("com.gradleup.shadow") version "8.3.0"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
group = property("group")!!
|
group = property("group")!!
|
||||||
|
@ -13,6 +9,9 @@ val ktor_version: String by project
|
||||||
val log4j_version: String by project
|
val log4j_version: String by project
|
||||||
val exposed_version: String by project
|
val exposed_version: String by project
|
||||||
|
|
||||||
|
allprojects {
|
||||||
|
apply(plugin = "org.jetbrains.kotlin.jvm")
|
||||||
|
|
||||||
java {
|
java {
|
||||||
toolchain {
|
toolchain {
|
||||||
languageVersion.set(JavaLanguageVersion.of(21))
|
languageVersion.set(JavaLanguageVersion.of(21))
|
||||||
|
@ -25,7 +24,9 @@ java {
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
subprojects {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(kotlin("stdlib"))
|
implementation(kotlin("stdlib"))
|
||||||
implementation(kotlin("reflect"))
|
implementation(kotlin("reflect"))
|
||||||
|
@ -41,31 +42,8 @@ dependencies {
|
||||||
testImplementation(platform("org.junit:junit-bom:5.10.0"))
|
testImplementation(platform("org.junit:junit-bom:5.10.0"))
|
||||||
testImplementation("org.junit.jupiter:junit-jupiter")
|
testImplementation("org.junit.jupiter:junit-jupiter")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
|
||||||
withType<KotlinCompile> {
|
|
||||||
compilerOptions {
|
|
||||||
jvmTarget.set(JvmTarget.JVM_21)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
processResources {
|
tasks.test {
|
||||||
filesMatching("*.properties") {
|
|
||||||
expand(project.properties)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
shadowJar {
|
|
||||||
archiveBaseName.set(project.name)
|
|
||||||
archiveClassifier.set("")
|
|
||||||
archiveVersion.set("")
|
|
||||||
|
|
||||||
manifest {
|
|
||||||
attributes["Main-Class"] = "net.projecttl.p.x32.Px32Kt"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
test {
|
|
||||||
useJUnitPlatform()
|
useJUnitPlatform()
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
46
px32-bot-core/build.gradle.kts
Normal file
46
px32-bot-core/build.gradle.kts
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||||
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
id("com.gradleup.shadow") version "8.3.0"
|
||||||
|
}
|
||||||
|
|
||||||
|
group = "net.projecttl"
|
||||||
|
version = "0.1.0-SNAPSHOT"
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
testImplementation(platform("org.junit:junit-bom:5.10.0"))
|
||||||
|
testImplementation("org.junit.jupiter:junit-jupiter")
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks {
|
||||||
|
withType<KotlinCompile> {
|
||||||
|
compilerOptions {
|
||||||
|
jvmTarget.set(JvmTarget.JVM_21)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
processResources {
|
||||||
|
filesMatching("*.properties") {
|
||||||
|
expand(project.properties)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
shadowJar {
|
||||||
|
archiveBaseName.set(project.name)
|
||||||
|
archiveClassifier.set("")
|
||||||
|
archiveVersion.set("")
|
||||||
|
|
||||||
|
manifest {
|
||||||
|
attributes["Main-Class"] = "net.projecttl.p.x32.Px32Kt"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
test {
|
||||||
|
useJUnitPlatform()
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
package net.projecttl.p.x32
|
package net.projecttl.p.x32
|
||||||
|
|
||||||
|
import net.dv8tion.jda.api.JDA
|
||||||
import net.projecttl.p.x32.command.Avatar
|
import net.projecttl.p.x32.command.Avatar
|
||||||
import net.projecttl.p.x32.command.Ping
|
import net.projecttl.p.x32.command.Ping
|
||||||
import net.projecttl.p.x32.config.DefaultConfig
|
import net.projecttl.p.x32.config.DefaultConfig
|
||||||
|
@ -8,6 +9,7 @@ import net.projecttl.p.x32.kernel.CoreKernel
|
||||||
import org.slf4j.Logger
|
import org.slf4j.Logger
|
||||||
import org.slf4j.LoggerFactory
|
import org.slf4j.LoggerFactory
|
||||||
|
|
||||||
|
lateinit var jda: JDA
|
||||||
val logger: Logger = LoggerFactory.getLogger(Px32::class.java)
|
val logger: Logger = LoggerFactory.getLogger(Px32::class.java)
|
||||||
|
|
||||||
fun main() {
|
fun main() {
|
||||||
|
@ -19,7 +21,7 @@ fun main() {
|
||||||
handler.addCommand(Avatar)
|
handler.addCommand(Avatar)
|
||||||
handler.addCommand(Ping)
|
handler.addCommand(Ping)
|
||||||
|
|
||||||
kernel.build()
|
jda = kernel.build()
|
||||||
}
|
}
|
||||||
|
|
||||||
class Px32
|
class Px32
|
|
@ -13,7 +13,7 @@ object Avatar : UserContext {
|
||||||
override suspend fun execute(ev: UserContextInteractionEvent) {
|
override suspend fun execute(ev: UserContextInteractionEvent) {
|
||||||
val embed = EmbedBuilder()
|
val embed = EmbedBuilder()
|
||||||
embed.setTitle(":frame_photo: ${ev.name} Avatar")
|
embed.setTitle(":frame_photo: ${ev.name} Avatar")
|
||||||
embed.setImage(ev.target.effectiveAvatarUrl)
|
embed.setImage("${ev.target.effectiveAvatarUrl}?size=512")
|
||||||
embed.colour()
|
embed.colour()
|
||||||
|
|
||||||
ev.replyEmbeds(embed.build()).queue()
|
ev.replyEmbeds(embed.build()).queue()
|
|
@ -1 +1,2 @@
|
||||||
rootProject.name = "px32-bot"
|
rootProject.name = "px32-bot"
|
||||||
|
include("px32-bot-core")
|
||||||
|
|
Loading…
Reference in a new issue