Skip to content

Commit 21ceccc

Browse files
committed
Initial commit
0 parents  commit 21ceccc

17 files changed

Lines changed: 1077 additions & 0 deletions

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

build.gradle

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
plugins {
2+
id 'java'
3+
id 'application'
4+
id 'com.github.johnrengelman.shadow' version '5.2.0'
5+
}
6+
7+
group 'com.polymars'
8+
version '1.0'
9+
10+
mainClassName = "Bot"
11+
sourceCompatibility = 1.8;
12+
13+
repositories {
14+
mavenCentral()
15+
jcenter()
16+
}
17+
18+
dependencies {
19+
compile 'net.dv8tion:JDA:4.1.1_162'
20+
}

gradle/wrapper/gradle-wrapper.jar

57.3 KB
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Thu Jun 11 09:36:06 CDT 2020
2+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1-all.zip
3+
distributionBase=GRADLE_USER_HOME
4+
distributionPath=wrapper/dists
5+
zipStorePath=wrapper/dists
6+
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 183 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gradlew.bat

Lines changed: 100 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

settings.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
rootProject.name = 'Sokobot'
2+

src/main/java/Bot.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import net.dv8tion.jda.api.AccountType;
2+
import net.dv8tion.jda.api.JDABuilder;
3+
import net.dv8tion.jda.api.OnlineStatus;
4+
import net.dv8tion.jda.api.entities.Activity;
5+
6+
import javax.security.auth.login.LoginException;
7+
import java.io.IOException;
8+
import java.nio.file.Files;
9+
import java.nio.file.Paths;
10+
11+
public class Bot {
12+
static String prefix = "!";
13+
14+
public static void main(String[] args) throws LoginException, IOException {
15+
JDABuilder builder = new JDABuilder(AccountType.BOT);
16+
String token = new String(Files.readAllBytes(Paths.get("token.txt")));
17+
builder.setToken(token);
18+
builder.setStatus(OnlineStatus.ONLINE);
19+
builder.setActivity(Activity.playing("!play to play Sokoban!"));
20+
builder.addEventListeners(new Commands());
21+
builder.build();
22+
}
23+
}

0 commit comments

Comments
 (0)