Skip to content

Commit

Permalink
Implement Slash Support into Flight (3.0.0) (#19)
Browse files Browse the repository at this point in the history
* Starting

* functional slash command stuff

* Fixing argument parsing of Context commands

* Support basic argument parsing, functional stuff.

* Allow filling in args with default values

* Defaults take precedence over null

* 3.0.0

* Event emitter changes, extra stuff.

* Upgrade Gradle version to compile to Java 17 (#16)

* Upgrade Gradle version to compile to Java 17

* Fix MessageContext to reflect changes in the JDA API.

* Pushing changes

* Cleanup build.gradle and a few warnings.

* Another attempt to fix Jitpack builds

* Another.

* Update permissions of gradlew

* Gradle wrapper.

* Works on my PC?

* An oversight

* Working locally.

* Expose JDA in Context

* Expose Member in Context

* cleanup parsers

* Simplify discriminator check

* Extract if out of else statement

* Consistent and concise naming

* Build against JDA 5.0.0-alpha.17

* Add reply handling to SlashContext

* Remove debug logging

* CommandRegistry#toDiscordCommands, argument descriptions

* Filter slash or higher

* Implement slashFriendlyName in argument

* Use Argument.slashFriendlyName

* strictly match an uppercase char to denote split boundary

* Accept java types as well...

* Lazily instantiate slashFriendlyName, match options to it

* Trial int conversion

* Description may not be empty.

* Improve SLASH_NAME_REGEX

* Crude number range support

* Slash subcommand support

* Bump to JDA alpha 18, deprecate Attachment, bug fix Attachment OptionType

* Switch to value to avoid keyword usage

* Provide ways of clearing cooldowns

* Implement checks for slash commands

* Docs for new CooldownProvider methods

* Detect executionContext from Context parameter type

* Update JDA to JDA5 alpha 22, fix classes after channel refactor (#17)

* Fixing compilation error in pull #17 (#18)

* Update JDA to JDA5 alpha 22, fix classes after channel refactor

* Fix compilation error in CommandClient

* Improvements to help command.

* Register DefaultEventAdapter when none are present

Co-authored-by: Abel Moarrensis <[email protected]>
Co-authored-by: Duale Siad <[email protected]>
  • Loading branch information
3 people authored Nov 2, 2022
1 parent b86fdb3 commit e499bc6
Show file tree
Hide file tree
Showing 52 changed files with 1,127 additions and 515 deletions.
77 changes: 48 additions & 29 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,49 +1,45 @@
buildscript {
ext.kotlin_stdlib = '1.3.72'
ext.kotlin_coroutines = '1.0.1'

repositories {
jcenter()
mavenCentral()
}

dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_stdlib"
}
plugins {
id 'com.github.johnrengelman.shadow' version '7.1.2'
id 'org.jetbrains.kotlin.jvm' version '1.6.21'
id 'maven-publish'
}

apply plugin: 'kotlin'
apply plugin: 'com.github.johnrengelman.shadow'

group 'me.devoxin'
version '2.1.0'
sourceCompatibility = 1.8
version '3.0.0'

repositories {
jcenter()
maven {
url 'https://m2.dv8tion.net/releases'
name 'm2-dv8tion'
}
mavenCentral()
jcenter()
maven { url 'https://jitpack.io' }
}

dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_stdlib"
compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_stdlib"
compile "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines"
compile "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:$kotlin_coroutines"
def kotlinVersion = '1.7.10'
def coroutinesVersion = '1.6.4'
def jdaVersion = '5.0.0-alpha.22'

implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:$coroutinesVersion"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
implementation 'org.reflections:reflections:0.10.2'
compileOnly "net.dv8tion:JDA:$jdaVersion"
api 'org.slf4j:slf4j-api:1.7.36'

compile 'org.reflections:reflections:0.9.11'
compileOnly 'net.dv8tion:JDA:4.0.0_52'
api 'org.slf4j:slf4j-api:1.7.25'
testImplementation "net.dv8tion:JDA:$jdaVersion"
}

compileKotlin {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.jvmTarget = '1.8'
}

def getBuildVersion() {
String getBuildVersion() {
def gitVersion = new ByteArrayOutputStream()
exec {
commandLine("git", "rev-parse", "--short", "HEAD")
commandLine('git', 'rev-parse', '--short', 'HEAD')
standardOutput = gitVersion
}
return "$version\n${gitVersion.toString().trim()}"
Expand All @@ -60,6 +56,29 @@ task writeVersion() {
file("$resourcePath/flight.txt").text = getBuildVersion()
}

publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
repositories {
mavenLocal()
}
}

task mavenPublishTask {
doLast {
publishToMavenLocal
}
}

build {
dependsOn writeVersion
finalizedBy(mavenPublishTask)
}

shadowJar {
dependsOn writeVersion
finalizedBy(mavenPublishTask)
}
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit e499bc6

Please sign in to comment.