commit
c5ace98962
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,2 @@
|
||||
#Wed Feb 16 00:50:56 GMT 2022
|
||||
gradle.version=7.2
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,3 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="17" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
</set>
|
||||
</option>
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RemoteRepositoriesConfiguration">
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Maven Central repository" />
|
||||
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="jboss.community" />
|
||||
<option name="name" value="JBoss Community repository" />
|
||||
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="MavenRepo" />
|
||||
<option name="name" value="MavenRepo" />
|
||||
<option name="url" value="https://repo.maven.apache.org/maven2/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="maven" />
|
||||
<option name="name" value="maven" />
|
||||
<option name="url" value="https://jitpack.io" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,124 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Palette2">
|
||||
<group name="Swing">
|
||||
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
|
||||
</item>
|
||||
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
|
||||
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
|
||||
<initial-values>
|
||||
<property name="text" value="Button" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="RadioButton" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="CheckBox" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="Label" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||
<preferred-size width="200" height="200" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||
<preferred-size width="200" height="200" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
|
||||
<preferred-size width="-1" height="20" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
|
||||
</item>
|
||||
</group>
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,25 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
}
|
||||
|
||||
group 'org.example'
|
||||
version '1.0-SNAPSHOT'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven { url 'https://jitpack.io' }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
|
||||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
|
||||
implementation "net.dv8tion:JDA:5.0.0-alpha.3"
|
||||
implementation 'com.github.Philipinho:CoinGecko-Java:e5a72c7083'
|
||||
implementation 'commons-io:commons-io:2.11.0'
|
||||
implementation 'org.bouncycastle:bcpkix-jdk15on:1.69'
|
||||
implementation 'org.jsoup:jsoup:1.14.3'
|
||||
}
|
||||
|
||||
test {
|
||||
useJUnitPlatform()
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
@ -0,0 +1,185 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
#
|
||||
# Copyright 2015 the original author or authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MSYS* | MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=`expr $i + 1`
|
||||
done
|
||||
case $i in
|
||||
0) set -- ;;
|
||||
1) set -- "$args0" ;;
|
||||
2) set -- "$args0" "$args1" ;;
|
||||
3) set -- "$args0" "$args1" "$args2" ;;
|
||||
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=`save "$@"`
|
||||
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
|
||||
exec "$JAVACMD" "$@"
|
@ -0,0 +1,89 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
After Width: | Height: | Size: 117 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 55 KiB |
After Width: | Height: | Size: 2.2 MiB |
@ -0,0 +1,2 @@
|
||||
rootProject.name = 'WowneroChanBot'
|
||||
|
@ -0,0 +1,140 @@
|
||||
package WowneroChanBot;
|
||||
|
||||
import net.dv8tion.jda.api.entities.MessageChannel;
|
||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||
import net.dv8tion.jda.api.hooks.ListenerAdapter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import static WowneroChanBot.Converter.*;
|
||||
import static WowneroChanBot.WowneroChanBot.BOT_NAME;
|
||||
import static WowneroChanBot.WowneroChanBot.jda;
|
||||
|
||||
public class Commands extends ListenerAdapter {
|
||||
|
||||
private static final String COMMAND_PREFIX = "/";
|
||||
|
||||
private static final String ABOUT_COMMAND = "/about";
|
||||
private static final String GETTING_STARTED_COMMAND = "/start";
|
||||
private static final String ELI5_COMMAND = "/eli5";
|
||||
|
||||
private static final String HELP_COMMAND = "/help";
|
||||
private static final String COMMANDS_COMMAND = "/commands";
|
||||
|
||||
private static final String CHOOSE_WOWLET_COMMAND = "/choosewowlet";
|
||||
private static final String CLI_WOWLET_COMMAND = "/cli";
|
||||
private static final String GUI_WOWLET_COMMAND = "/desktop";
|
||||
private static final String WEB_WOWLET_COMMAND = "/web";
|
||||
private static final String WOWNERUJO_COMMAND = "/wownerujo";
|
||||
private static final String PAPER_WOWLET_COMMAND = "/paper";
|
||||
private static final String ALL_WOWLETS_COMMAND = "/allwowlets";
|
||||
|
||||
private static final String HI_COMMAND = "/hi";
|
||||
private static final String RICH_LIST_COMMAND = "/richlist";
|
||||
|
||||
private static final String WOW_PRICE_COMMAND = "/price";
|
||||
private static final String WOW_TO_USD_COMMAND = "/wowusd";
|
||||
private static final String USD_TO_WOW_COMMAND = "/usdwow";
|
||||
private static final String WOW_TO_BTC_COMMAND = "/wowbtc";
|
||||
private static final String BTC_TO_WOW_COMMAND = "/btcwow";
|
||||
private static final String XMR_TO_WOW_COMMAND = "/xmrwow";
|
||||
private static final String WOW_TO_XMR_COMMAND = "wowxmr";
|
||||
|
||||
private static final String DONATE_COMMAND = "/donate";
|
||||
|
||||
public void onMessageReceived(MessageReceivedEvent msgReceivedEvent) {
|
||||
String[] msgArray = msgReceivedEvent.getMessage().getContentRaw().split("\\s+");
|
||||
String authorName = msgReceivedEvent.getAuthor().getName();
|
||||
Responses responses = new Responses();
|
||||
|
||||
MessageChannel messageChannel = getMessageChannel(msgReceivedEvent);
|
||||
|
||||
if(msgArray[0].startsWith(COMMAND_PREFIX)) {
|
||||
switch (msgArray[0]) {
|
||||
case HI_COMMAND -> messageChannel.sendMessage(responses.hiReply(authorName)).queue();
|
||||
case ABOUT_COMMAND -> messageChannel.sendMessageEmbeds(responses.aboutReply()).queue();
|
||||
case GETTING_STARTED_COMMAND -> messageChannel.sendMessageEmbeds(responses.gettingStartedReply()).queue();
|
||||
case ELI5_COMMAND -> messageChannel.sendMessageEmbeds(responses.eliFiveReply()).queue();
|
||||
case COMMANDS_COMMAND, HELP_COMMAND -> messageChannel.sendMessageEmbeds(responses.commandsReply()).queue();
|
||||
case RICH_LIST_COMMAND -> messageChannel.sendMessageEmbeds(responses.richListReply()).queue();
|
||||
case DONATE_COMMAND -> messageChannel.sendMessageEmbeds(responses.donateReply()).queue();
|
||||
case WOW_PRICE_COMMAND -> messageChannel.sendMessageEmbeds(responses.getPriceReply()).queue();
|
||||
case WOW_TO_USD_COMMAND -> messageChannel.sendMessageEmbeds(responses.conversionReply(WOW_TO_USD, (checkForSecondWord(msgArray)) ? msgArray[1] : null)).queue();
|
||||
case USD_TO_WOW_COMMAND -> messageChannel.sendMessageEmbeds(responses.conversionReply(USD_TO_WOW, (checkForSecondWord(msgArray)) ? msgArray[1] : null)).queue();
|
||||
case WOW_TO_BTC_COMMAND -> messageChannel.sendMessageEmbeds(responses.conversionReply(WOW_TO_BTC, (checkForSecondWord(msgArray)) ? msgArray[1] : null)).queue();
|
||||
case BTC_TO_WOW_COMMAND -> messageChannel.sendMessageEmbeds(responses.conversionReply(BTC_TO_WOW, (checkForSecondWord(msgArray)) ? msgArray[1] : null)).queue();
|
||||
case XMR_TO_WOW_COMMAND -> messageChannel.sendMessageEmbeds(responses.conversionReply(XMR_TO_WOW, (checkForSecondWord(msgArray)) ? msgArray[1] : null)).queue();
|
||||
case WOW_TO_XMR_COMMAND -> messageChannel.sendMessageEmbeds(responses.conversionReply(WOW_TO_XMR, (checkForSecondWord(msgArray)) ? msgArray[1] : null)).queue();
|
||||
case CHOOSE_WOWLET_COMMAND -> messageChannel.sendMessageEmbeds(responses.walletTypesReply()).queue();
|
||||
case CLI_WOWLET_COMMAND -> messageChannel.sendMessageEmbeds(responses.cliReply()).queue();
|
||||
case GUI_WOWLET_COMMAND -> messageChannel.sendMessageEmbeds(responses.guiReply()).queue();
|
||||
case WEB_WOWLET_COMMAND -> messageChannel.sendMessageEmbeds(responses.webReply()).queue();
|
||||
case WOWNERUJO_COMMAND -> messageChannel.sendMessageEmbeds(responses.wownerujoReply()).queue();
|
||||
case PAPER_WOWLET_COMMAND -> messageChannel.sendMessageEmbeds(responses.paperReply()).queue();
|
||||
case ALL_WOWLETS_COMMAND -> messageChannel.sendMessageEmbeds(responses.allWowletsReply()).queue();
|
||||
case "/img" -> messageChannel.sendMessageEmbeds(responses.memeReply()).queue();
|
||||
}
|
||||
} else {
|
||||
boolean hi = (msgArray[0].equals("hi") && msgArray.length == 1)
|
||||
|| (msgArray[0].equals("hey") && msgArray.length == 1) || (msgArray[0].equals("hello") && msgArray.length == 1)
|
||||
|| checkMessageForStringCombo(msgArray, new String[]{"Hi", BOT_NAME}, msgReceivedEvent.getAuthor().getName())
|
||||
|| checkMessageForStringCombo(msgArray, new String[]{"Hey", BOT_NAME}, msgReceivedEvent.getAuthor().getName())
|
||||
|| checkMessageForStringCombo(msgArray, new String[]{"Hello", BOT_NAME}, msgReceivedEvent.getAuthor().getName());
|
||||
boolean uwu = checkMessageForStringCombo(msgArray, new String[]{"uwu"}, msgReceivedEvent.getAuthor().getName());
|
||||
boolean owo = checkMessageForStringCombo(msgArray, new String[]{"owo"}, msgReceivedEvent.getAuthor().getName());
|
||||
boolean heart = (msgArray[0].equals("<3") && msgArray.length == 1 && !authorName.equals(BOT_NAME)) ||
|
||||
checkMessageForStringCombo(msgArray, new String[]{BOT_NAME, "<3"}, msgReceivedEvent.getAuthor().getName()) ||
|
||||
checkMessageForStringCombo(msgArray, new String[]{"I", "love", BOT_NAME}, msgReceivedEvent.getAuthor().getName());
|
||||
|
||||
if(hi || uwu || owo || heart) {
|
||||
msgReceivedEvent.getChannel().sendTyping().queue();
|
||||
}
|
||||
|
||||
if (hi) {
|
||||
messageChannel.sendMessage(responses.hiReply(authorName)).queue();
|
||||
}
|
||||
else if (uwu) {
|
||||
messageChannel.sendMessage(responses.uwuReply()).queue();
|
||||
}
|
||||
else if (owo) {
|
||||
messageChannel.sendMessage(responses.owoReply()).queue();
|
||||
}
|
||||
else if (heart) {
|
||||
messageChannel.sendMessage(responses.heartReply()).queue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static MessageChannel getMessageChannel(MessageReceivedEvent msgReceivedEvent) {
|
||||
try {
|
||||
return msgReceivedEvent.getPrivateChannel();
|
||||
} catch (IllegalStateException notPrivateChannelException) {
|
||||
return msgReceivedEvent.getChannel();
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean checkForSecondWord(String[] msgArray) {
|
||||
try {
|
||||
if(msgArray[1].isBlank() || msgArray[1].isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
} catch (ArrayIndexOutOfBoundsException arrayIndexOutOfBoundsException) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private static boolean checkMessageForStringCombo(String[] messageArray, String[] searchWords, String authorName) {
|
||||
boolean allWordsFound = false;
|
||||
|
||||
for (String searchWord : searchWords) {
|
||||
if ((Arrays.stream(messageArray).anyMatch(searchWord::equalsIgnoreCase)) &&
|
||||
!authorName.equalsIgnoreCase(BOT_NAME)) {
|
||||
allWordsFound = true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return allWordsFound;
|
||||
}
|
||||
}
|
@ -0,0 +1,173 @@
|
||||
package WowneroChanBot;
|
||||
|
||||
import com.litesoftwares.coingecko.CoinGeckoApiClient;
|
||||
import com.litesoftwares.coingecko.constant.Currency;
|
||||
import com.litesoftwares.coingecko.impl.CoinGeckoApiClientImpl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.MathContext;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.Locale;
|
||||
|
||||
import static WowneroChanBot.Responses.*;
|
||||
|
||||
public class Converter {
|
||||
|
||||
private static final CoinGeckoApiClient client = new CoinGeckoApiClientImpl();
|
||||
|
||||
private static final String WOWNERO = "wownero";
|
||||
|
||||
private static final int IS_LESS_THAN_ONE = 0;
|
||||
private static final int IS_LESS_THAN_TEN = 1;
|
||||
private static final int IS_LESS_THAN_THOUSAND = 2;
|
||||
private static final int IS_LESS_THAN_HUNDRED_THOUSAND = 3;
|
||||
|
||||
public static final int WOW_TO_USD = 1;
|
||||
public static final int USD_TO_WOW = 2;
|
||||
public static final int WOW_TO_BTC = 3;
|
||||
public static final int BTC_TO_WOW = 4;
|
||||
public static final int WOW_TO_XMR = 5;
|
||||
public static final int XMR_TO_WOW = 6;
|
||||
|
||||
private BigDecimal getWowPriceInUsd() {
|
||||
return BigDecimal.valueOf(client.getPrice(WOWNERO, Currency.USD).get(WOWNERO).get(Currency.USD));
|
||||
}
|
||||
public String getWowPriceInUsdAsString(){
|
||||
return formatUsdAmountAsString(getWowPriceInUsd());
|
||||
}
|
||||
|
||||
private BigDecimal getWowPriceInBtc(){
|
||||
return BigDecimal.valueOf(client.getPrice(WOWNERO, Currency.BTC).get(WOWNERO).get(Currency.BTC));
|
||||
}
|
||||
public String getWowPriceInBtcAsString(){
|
||||
return formatBtcAmountAsString(getWowPriceInBtc());
|
||||
}
|
||||
|
||||
private BigDecimal getWowPriceInXmr() {
|
||||
return BigDecimal.valueOf(client.getPrice(WOWNERO, Currency.USD).get(WOWNERO).get(Currency.USD))
|
||||
.divide(BigDecimal.valueOf(client.getPrice("monero", Currency.USD).get("monero").get(Currency.USD)), MathContext.DECIMAL128);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String convertWowToUsd(String wowAmountString) {
|
||||
try {
|
||||
return formatUsdAmountAsString(new BigDecimal(wowAmountString).multiply(getWowPriceInUsd()));
|
||||
} catch (NumberFormatException numberFormatException) {
|
||||
return WOW_TO_USD_MISSING_AMOUNT_REPLY;
|
||||
}
|
||||
}
|
||||
public String convertUsdToWow(String usdAmountString) {
|
||||
try {
|
||||
return formatWowAmountAsString(new BigDecimal((usdAmountString)).divide(getWowPriceInUsd(), MathContext.DECIMAL128));
|
||||
} catch (NumberFormatException numberFormatException) {
|
||||
return USD_TO_WOW_MISSING_AMOUNT_REPLY;
|
||||
}
|
||||
}
|
||||
|
||||
public String convertBtcToWow(String btcAmountString) {
|
||||
try {
|
||||
return formatWowAmountAsString(new BigDecimal(btcAmountString).divide(getWowPriceInBtc(), MathContext.DECIMAL128));
|
||||
} catch (NumberFormatException numberFormatException) {
|
||||
return BTC_TO_WOW_MISSING_AMOUNT_REPLY;
|
||||
}
|
||||
}
|
||||
public String convertWowToBtc(String wowAmountString) {
|
||||
try {
|
||||
return formatBtcAmountAsString(new BigDecimal(wowAmountString).multiply(getWowPriceInBtc()));
|
||||
} catch (NumberFormatException numberFormatException) {
|
||||
return WOW_TO_BTC_MISSING_AMOUNT_REPLY;
|
||||
}
|
||||
}
|
||||
|
||||
public String convertWowToXmr(String wowAmountString) {
|
||||
try {
|
||||
return formatXmrAmountAsString(new BigDecimal(wowAmountString).multiply(getWowPriceInXmr()));
|
||||
} catch (NumberFormatException numberFormatException) {
|
||||
return WOW_TO_XMR_MISSING_AMOUNT_REPLY;
|
||||
}
|
||||
}
|
||||
public String convertXmrToWow(String xmrAmountString) {
|
||||
try {
|
||||
return formatWowAmountAsString(new BigDecimal(xmrAmountString).divide(getWowPriceInXmr(), MathContext.DECIMAL128));
|
||||
}
|
||||
catch (NumberFormatException numberFormatException) {
|
||||
return XMR_TO_WOW_MISSING_AMOUNT_REPLY;
|
||||
}
|
||||
}
|
||||
|
||||
private String formatWowAmountAsString(BigDecimal wowAmount) {
|
||||
boolean[] xmrAmountBoolean = amountBooleanArray(wowAmount);
|
||||
|
||||
if (xmrAmountBoolean[IS_LESS_THAN_ONE]) {
|
||||
return new DecimalFormat("#.############").format(wowAmount) + " WOW";
|
||||
} else {
|
||||
if (xmrAmountBoolean[IS_LESS_THAN_TEN]) {
|
||||
return new DecimalFormat("#.###").format(wowAmount) + " WOW";
|
||||
} else if (xmrAmountBoolean[IS_LESS_THAN_THOUSAND]) {
|
||||
return new DecimalFormat("#.##").format(wowAmount) + " WOW";
|
||||
} else {
|
||||
NumberFormat numberFormat = NumberFormat.getNumberInstance(Locale.US);
|
||||
numberFormat.setMaximumFractionDigits(0);
|
||||
|
||||
return numberFormat.format(wowAmount) + " WOW";
|
||||
}
|
||||
}
|
||||
}
|
||||
private String formatUsdAmountAsString(BigDecimal usdAmount) {
|
||||
return NumberFormat.getCurrencyInstance(Locale.US).format(usdAmount);
|
||||
}
|
||||
private String formatBtcAmountAsString(BigDecimal btcAmount) {
|
||||
boolean[] btcAmountBoolean = amountBooleanArray(btcAmount);
|
||||
|
||||
if (btcAmountBoolean[IS_LESS_THAN_ONE]) {
|
||||
return new DecimalFormat("#.############").format(btcAmount) + " BTC";
|
||||
} else {
|
||||
if (btcAmountBoolean[IS_LESS_THAN_TEN]) {
|
||||
return new DecimalFormat("#.#####").format(btcAmount) + " BTC";
|
||||
} else if (btcAmountBoolean[IS_LESS_THAN_THOUSAND]) {
|
||||
return new DecimalFormat("#.###").format(btcAmount) + " BTC";
|
||||
} else {
|
||||
NumberFormat numberFormat = NumberFormat.getNumberInstance(Locale.US);
|
||||
numberFormat.setMaximumFractionDigits(0);
|
||||
|
||||
return numberFormat.format(btcAmount) + " BTC";
|
||||
}
|
||||
}
|
||||
}
|
||||
private String formatXmrAmountAsString(BigDecimal xmrAmount) {
|
||||
boolean[] btcAmountBoolean = amountBooleanArray(xmrAmount);
|
||||
|
||||
if (btcAmountBoolean[IS_LESS_THAN_ONE]) {
|
||||
return new DecimalFormat("#.############").format(xmrAmount) + " XMR";
|
||||
} else {
|
||||
if (btcAmountBoolean[IS_LESS_THAN_TEN]) {
|
||||
return new DecimalFormat("#.#####").format(xmrAmount) + " XMR";
|
||||
} else if (btcAmountBoolean[IS_LESS_THAN_THOUSAND]) {
|
||||
return new DecimalFormat("#.###").format(xmrAmount) + " XMR";
|
||||
} else {
|
||||
NumberFormat numberFormat = NumberFormat.getNumberInstance(Locale.US);
|
||||
numberFormat.setMaximumFractionDigits(0);
|
||||
|
||||
return numberFormat.format(xmrAmount) + " XMR";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean[] amountBooleanArray(BigDecimal amount) {
|
||||
boolean[] amountBooleanArray = {false, false, false};
|
||||
|
||||
if (amount.compareTo(BigDecimal.ONE) <= 0) {
|
||||
amountBooleanArray[IS_LESS_THAN_ONE] = true;
|
||||
} else if (amount.compareTo(BigDecimal.TEN) < 0) {
|
||||
amountBooleanArray[IS_LESS_THAN_TEN] = true;
|
||||
} else if (amount.compareTo(BigDecimal.TEN) >= 0 && amount.compareTo(BigDecimal.valueOf(1000)) < 0) {
|
||||
amountBooleanArray[IS_LESS_THAN_THOUSAND] = true;
|
||||
}
|
||||
|
||||
return amountBooleanArray;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,10 @@
|
||||
package WowneroChanBot;
|
||||
|
||||
import net.dv8tion.jda.api.events.guild.member.GuildMemberJoinEvent;
|
||||
import net.dv8tion.jda.api.hooks.ListenerAdapter;
|
||||
|
||||
public class MemberJoinResponse extends ListenerAdapter {
|
||||
public void onGuildMemberJoin(GuildMemberJoinEvent guildMemberJoinEvent) {
|
||||
guildMemberJoinEvent.getGuild().getDefaultChannel().sendMessage(new Responses().memberJoinReply(guildMemberJoinEvent.getUser().getName())).queue();
|
||||
}
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package WowneroChanBot;
|
||||
|
||||
import org.jsoup.Jsoup;
|
||||
import org.jsoup.nodes.Document;
|
||||
import org.jsoup.nodes.Element;
|
||||
import org.jsoup.select.Elements;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class Memes {
|
||||
|
||||
public String getLatestMeme() {
|
||||
return getImgUrlString("https://suchwow.xyz/");
|
||||
}
|
||||
|
||||
public String getTopMeme() {
|
||||
return getImgUrlString("https://suchwow.xyz/leaderboards/top_posts?days=9999");
|
||||
}
|
||||
|
||||
public String[] getRandomMemes() {
|
||||
return null;
|
||||
}
|
||||
|
||||
private static String getImgUrlString(String postUrl) {
|
||||
Document doc = null;
|
||||
try {
|
||||
return Jsoup.connect(postUrl).userAgent("Mozilla/5.0").timeout(10000).get().select("img").get(1).absUrl("src");
|
||||
}
|
||||
|
||||
catch (IOException | NullPointerException getRequestFailedException) {
|
||||
getRequestFailedException.printStackTrace();
|
||||
System.out.println("Could not retrieve image :(");
|
||||
return "null";
|
||||
}
|
||||
}
|
||||
|
||||
public String getLatestMemeUrl() {
|
||||
Document doc = null;
|
||||
try {
|
||||
doc = Jsoup.connect("https://suchwow.xyz/").userAgent("Mozilla/5.0").timeout(10000).get();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
Element link = doc.select("p.title is-4 > a").first();
|
||||
String url = link.attr("href");
|
||||
return url;
|
||||
}
|
||||
|
||||
// private static int getNumberOfMemes() {
|
||||
//
|
||||
// }
|
||||
|
||||
// private String getRandomMemeUrl(int totalMemes) {
|
||||
// Random random = new Random();
|
||||
// random.nextInt(1, )
|
||||
// }
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package WowneroChanBot;
|
||||
|
||||
import net.dv8tion.jda.api.events.guild.GuildJoinEvent;
|
||||
import net.dv8tion.jda.api.hooks.ListenerAdapter;
|
||||
|
||||
public class ServerJoinResponse extends ListenerAdapter {
|
||||
public void onGuildJoin(GuildJoinEvent guildJoinEvent) {
|
||||
guildJoinEvent.getGuild().getDefaultChannel().sendMessageEmbeds(new Responses().serverJoinReply()).queue();
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package WowneroChanBot;
|
||||
|
||||
import net.dv8tion.jda.api.JDA;
|
||||
import net.dv8tion.jda.api.JDABuilder;
|
||||
import net.dv8tion.jda.api.OnlineStatus;
|
||||
import net.dv8tion.jda.api.entities.Activity;
|
||||
import net.dv8tion.jda.api.requests.GatewayIntent;
|
||||
import javax.security.auth.login.LoginException;
|
||||
|
||||
public class WowneroChanBot {
|
||||
|
||||
public static JDA jda;
|
||||
|
||||
public static final String BOT_NAME = "WowneroChan";
|
||||
public static final String BOT_API_KEY = "";
|
||||
public static final String CURRENT_GAME = "Boating Simulator";
|
||||
|
||||
public static final String DEV_WOW_ADDRESS = "WW3gsJjJHgTXrMgYDkQHW1DAcWFxxqUmvAYCnBda3mGLiDesyeJX9PhS1URRNihQny727EzbJxqCG6XL7tV3awuR29QTRqDcB";
|
||||
public static final String DEV_XMR_ADDRESS = "88KBTppCLxZb2qS4jqfVfXN3kqioyqtWkjf9RRY9LSW3GTwXxoCX3x7UxYnAoZi3XjHDBfVBBFPZ28fppHPPjSg1MJY6eg6";
|
||||
|
||||
public static void main (String[] args) throws LoginException {
|
||||
jda = JDABuilder.createDefault(BOT_API_KEY)
|
||||
.setActivity(Activity.playing(CURRENT_GAME))
|
||||
.setStatus(OnlineStatus.ONLINE)
|
||||
.enableIntents(GatewayIntent.GUILD_MEMBERS)
|
||||
.addEventListeners(new Commands(), new MemberJoinResponse(), new ServerJoinResponse())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in new issue