Skip to content
This repository has been archived by the owner on Jul 25, 2024. It is now read-only.

Commit

Permalink
Remove brigadier and replaced it with JDA's stuff (#135)
Browse files Browse the repository at this point in the history
* Ignore eclipse files

* update gitignore

* switch to gradle

* Add Brigadier command parser

* Push progress, not finished yet.

* gitignore should not ignore itself

* Remove remnants from roll

* Push more progress

* Update README.md

For changes to gradle

* Update README.md

Don't bug the guy, he doesn't work on this anymore.

* Push more progress

* It compiles

* Delete maven.yml

* Create dependabot.yml

* Create codeql.yml

* Fix gradle jar not being included in the repository

* Update README.md

Correct build output location

* Update README.md

* Delete pr.yml

* Bump ch.qos.logback:logback-core from 1.2.3 to 1.4.7

Bumps [ch.qos.logback:logback-core](https://github.com/qos-ch/logback) from 1.2.3 to 1.4.7.
- [Commits](qos-ch/logback@v_1.2.3...v_1.4.7)

---
updated-dependencies:
- dependency-name: ch.qos.logback:logback-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump mysql:mysql-connector-java from 8.0.28 to 8.0.33

Bumps mysql:mysql-connector-java from 8.0.28 to 8.0.33.

---
updated-dependencies:
- dependency-name: mysql:mysql-connector-java
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump org.jsoup:jsoup from 1.10.3 to 1.16.1

Bumps [org.jsoup:jsoup](https://github.com/jhy/jsoup) from 1.10.3 to 1.16.1.
- [Release notes](https://github.com/jhy/jsoup/releases)
- [Changelog](https://github.com/jhy/jsoup/blob/master/CHANGES)
- [Commits](jhy/jsoup@jsoup-1.10.3...jsoup-1.16.1)

---
updated-dependencies:
- dependency-name: org.jsoup:jsoup
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump com.zaxxer:HikariCP from 2.6.0 to 5.0.1

Bumps [com.zaxxer:HikariCP](https://github.com/brettwooldridge/HikariCP) from 2.6.0 to 5.0.1.
- [Changelog](https://github.com/brettwooldridge/HikariCP/blob/dev/CHANGES)
- [Commits](brettwooldridge/HikariCP@HikariCP-2.6.0...HikariCP-5.0.1)

---
updated-dependencies:
- dependency-name: com.zaxxer:HikariCP
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump com.google.guava:guava from 30.1.1-jre to 31.1-jre

Bumps [com.google.guava:guava](https://github.com/google/guava) from 30.1.1-jre to 31.1-jre.
- [Release notes](https://github.com/google/guava/releases)
- [Commits](https://github.com/google/guava/commits)

---
updated-dependencies:
- dependency-name: com.google.guava:guava
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix UnsupportedOperationException

* The console can now execute commands

* Update dependabot.yml

* Bump com.google.code.gson:gson from 2.8.9 to 2.10.1

Bumps [com.google.code.gson:gson](https://github.com/google/gson) from 2.8.9 to 2.10.1.
- [Release notes](https://github.com/google/gson/releases)
- [Changelog](https://github.com/google/gson/blob/master/CHANGELOG.md)
- [Commits](google/gson@gson-parent-2.8.9...gson-parent-2.10.1)

---
updated-dependencies:
- dependency-name: com.google.code.gson:gson
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump org.yaml:snakeyaml from 1.29 to 2.0

Bumps [org.yaml:snakeyaml](https://bitbucket.org/snakeyaml/snakeyaml) from 1.29 to 2.0.
- [Commits](https://bitbucket.org/snakeyaml/snakeyaml/branches/compare/snakeyaml-2.0..snakeyaml-1.29)

---
updated-dependencies:
- dependency-name: org.yaml:snakeyaml
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump io.sentry:sentry-logback from 1.7.3 to 6.19.1

Bumps [io.sentry:sentry-logback](https://github.com/getsentry/sentry-java) from 1.7.3 to 6.19.1.
- [Release notes](https://github.com/getsentry/sentry-java/releases)
- [Changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md)
- [Commits](getsentry/sentry-java@v1.7.3...6.19.1)

---
updated-dependencies:
- dependency-name: io.sentry:sentry-logback
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* update loggers

* Bump org.codehaus.groovy:groovy-jsr223 from 3.0.8 to 3.0.17

Bumps [org.codehaus.groovy:groovy-jsr223](https://github.com/apache/groovy) from 3.0.8 to 3.0.17.
- [Commits](https://github.com/apache/groovy/commits)

---
updated-dependencies:
- dependency-name: org.codehaus.groovy:groovy-jsr223
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Admin commands can now be executed by owners

* Update LICENSE

* rm outdated comment

* I thought I deleted this shit

* Fix threading issues when retrieving discord users for suggestions

* Fix infinite loop when executing an invalid command.

* One command dispatcher now

* Fix AnyStringSuggestion

* GUILD_MEMBERS intent for suggestions

* Push the rest

* rm debug code

* make ping response empher

* State that riitag temporarily not working due to upstream issue

* more cleanup

* register flag command

* Fix UnsupportedOperationException

* Fix flag suggestions

* Add NON_COUNTRIES and COUNTRIES as valid FlagArgumentTypes

* CodeType suggestion no longer case sensitive

* New easy deferring system

* Fix isDiscordContext returning false if the context was an InteractionHook

* Migrate Error command to new context deferral system

* Readability

* grammar

* Fix commands with optional arguments not being able to be executed with no arguments in discord.

* oops

* Fix LiteralArgument suggestions fucking up suggestions

* ExciteSuggestionsBuilder -> RiiSuggestionsBuilder

* push

* Flag suggestions now show the flag image

* cleanup

* Fix flag names with spaces being unable to be parsed

* cleanup

* Remove MAC OS Finder remnants

* Update .gitignore

ignore MAC OS Finder file remnants

* Move brigadier stuff to its own library

* Update BDE to 0.3.0.0

* Update BDE to 0.3.1.1

* Bump io.sentry:sentry-logback from 6.19.1 to 6.20.0

Bumps [io.sentry:sentry-logback](https://github.com/getsentry/sentry-java) from 6.19.1 to 6.20.0.
- [Release notes](https://github.com/getsentry/sentry-java/releases)
- [Changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md)
- [Commits](getsentry/sentry-java@6.19.1...6.20.0)

---
updated-dependencies:
- dependency-name: io.sentry:sentry-logback
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* getAuthor() -> getUser()

* Update BDE to Version 0.4.0.0

* Add command descriptions and requirements

* Add all command requirements

* remove duplicate checks

* Update BDE to 0.4.1.0

* Bump com.google.guava:guava from 31.1-jre to 32.0.0-jre

Bumps [com.google.guava:guava](https://github.com/google/guava) from 31.1-jre to 32.0.0-jre.
- [Release notes](https://github.com/google/guava/releases)
- [Commits](https://github.com/google/guava/commits)

---
updated-dependencies:
- dependency-name: com.google.guava:guava
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Temporary fix for /riitag

* Fix issues with /flag and /code commands

* rm unused annotation

* Update BDE to 0.5.0.0

* Fix bot presence

* Update BDE to 0.5.0.1

* Bump io.sentry:sentry-logback from 6.20.0 to 6.21.0

Bumps [io.sentry:sentry-logback](https://github.com/getsentry/sentry-java) from 6.20.0 to 6.21.0.
- [Release notes](https://github.com/getsentry/sentry-java/releases)
- [Changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md)
- [Commits](getsentry/sentry-java@6.20.0...6.21.0)

---
updated-dependencies:
- dependency-name: io.sentry:sentry-logback
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Add missing command descriptions

* oops

* Update BDE to 0.5.0.2

* Bump com.datadoghq:java-dogstatsd-client from 2.8 to 4.2.0

Bumps [com.datadoghq:java-dogstatsd-client](https://github.com/DataDog/java-dogstatsd-client) from 2.8 to 4.2.0.
- [Release notes](https://github.com/DataDog/java-dogstatsd-client/releases)
- [Changelog](https://github.com/DataDog/java-dogstatsd-client/blob/master/CHANGELOG.md)
- [Commits](DataDog/java-dogstatsd-client@v2.8...v4.2.0)

---
updated-dependencies:
- dependency-name: com.datadoghq:java-dogstatsd-client
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update code for DataDogBuilder

* Remove unused command

* Removed brigadier and replaced it with JDA's stuff

* Minor changes

* Change Members to Users to allow command usage through dms

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Gamebuster19901 <Gamebuster19901@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Jul 27, 2023
1 parent d57d627 commit 2dfc2d5
Show file tree
Hide file tree
Showing 72 changed files with 1,953 additions and 2,694 deletions.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: "gradle"
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 99
81 changes: 81 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
schedule:
- cron: '21 19 * * 6'

jobs:
analyze:
name: Analyze
if: ${{github.event.pull_request.head.repo.full_name}} != {{$github.repository}}
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'java' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Set up JDK 19
uses: actions/setup-java@v1
with:
java-version: 19

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew build

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
30 changes: 0 additions & 30 deletions .github/workflows/maven.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/pr.yml

This file was deleted.

30 changes: 29 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,29 @@
# BlueJ files
*.ctxt

# eclipse
bin
*.launch
.metadata
.classpath
.project
/.settings

# idea
out
*.ipr
*.iws
*.iml
.idea

# gradle
build
.gradle

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files
*.jar
*.war
*.ear
*.zip
Expand All @@ -29,3 +47,13 @@ target/*
.idea/*
*.iml
dependency-reduced-pom.xml
polls_049.yml
polls_110.yml
.DS_Store

# eclipse
bin
.settings
.metadata
.classpath
.project
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017-2020 RiiConnect24 and its contributors
Copyright (c) 2017-2023 RiiConnect24 and its contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ I'm glad you asked.
##### A note: We no longer use [YAML](http://yaml.org/) except for the config (which was just a [Ruby](https://www.ruby-lang.org/) class before), as [Java](https://www.java.com/) really doesn't like [YAML](http://yaml.org/).

Check out the following steps:
1. You'll need to have MySQL and Maven installed.
1. You'll need to have MySQL installed.
2. We'll create the Redis structures as we go, so no need to set anything up.
3. `git clone` the repo somewhere and `cd` into it.
4. It's time to start building... Run `mvn package`! And... tada! That's it. You can find JAR(s) created in `target`. Easy!
4. It's time to start building... Run `./gradlew shadowJar`! And... tada! That's it. You can find JAR(s) created in `/build/libs`. Easy!
5. For running, make sure you have MySQL installed on whatever machine.

If you need support for the bot, head on over to [the bot's official support server](https://discord.gg/PVsh4jP) or DM `Artuto#0424 | 264499432538505217` in Discord.
If you need support for the bot, head on over to [the bot's official support server](https://discord.gg/PVsh4jP).

For more infos about JDA, [click here](https://github.com/DV8FromTheWorld/JDA).
84 changes: 84 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/*
* This file was generated by the Gradle 'init' task.
*/

plugins {
id 'java'
id 'maven-publish'
id 'eclipse'
id 'com.github.johnrengelman.shadow' version "8.1.1"
}

repositories {
mavenCentral()
maven {
url = uri('https://m2.dv8tion.net/releases/')
}

maven {
url = uri('https://repo.maven.apache.org/maven2/')
}

maven {
url "https://repo.spongepowered.org/maven/"
}

maven {
url = uri('https://repo.aikar.co/content/groups/aikar/')
}

}

dependencies {
shadow 'net.dv8tion:JDA:5.0.0-beta.12'
shadow 'io.sentry:sentry-logback:6.21.0'
shadow 'org.codehaus.groovy:groovy-jsr223:3.0.17'
shadow 'org.jsoup:jsoup:1.16.1'
shadow 'mysql:mysql-connector-java:8.0.33'
shadow 'co.aikar:idb-core:1.0.0-SNAPSHOT'
shadow 'com.zaxxer:HikariCP:5.0.1'
shadow 'org.yaml:snakeyaml:2.0'
shadow 'com.google.code.gson:gson:2.10.1'
shadow 'com.google.guava:guava:32.0.0-jre'
shadow 'com.datadoghq:java-dogstatsd-client:4.2.0'
shadow 'org.json:json:20230227'
shadow group: 'org.apache.commons', name: 'commons-text', version: '1.10.0'
}

shadowJar {
mergeServiceFiles()
configurations = [project.configurations.shadow]
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/LICENSsE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/DEPENDENCIES'
exclude 'LICENSE.txt'
}

group = 'xyz.rc24.bot'
version = '5.3.4'
description = 'RC24-Bot'
java.sourceCompatibility = JavaVersion.VERSION_19
compileJava.options.encoding = "UTF-8"
compileTestJava.options.encoding = "UTF-8"

jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest {
attributes(
'Class-Path': configurations.runtimeClasspath.collect { it.getName() }.join(' '),
'MixinConfigs': 'mixins.json',
'Main-Class': 'xyz.rc24.bot.RiiConnect24Bot',
'Specification-Version': 8.0,
'Multi-Release': 'true'
)
}
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
} {
exclude 'META-INF/*.RSA', 'META-INF/*.SF', 'META-INF/*.DSA'
}
}

Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 2dfc2d5

Please sign in to comment.