Skip to content

Commit

Permalink
add info command
Browse files Browse the repository at this point in the history
  • Loading branch information
Theaninova committed Aug 13, 2020
1 parent d6a3691 commit a8babb5
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 18 deletions.
16 changes: 4 additions & 12 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ A bot that automatically polls the newest blogpost from [Hytale News Tab](https:
## Setup
Okay, this isn't really meant for you to setup, if you want it though it first is easier to just dm me on Twitter [@tale_talk](https://twitter.com/tale_talk) so I can add you to the server list.
If you *really* want to set it up yourself, fine.
1. first clone the repo, build it, etc.
1. first go to the release tab, download the jar, and put it in a folder
2. Add two files in the root of the repo, an `admin.json` and a `servers.json`.
Add your Discord ID (not name), Bot token, and update frequency to the `admin.json`:
```json
Expand All @@ -13,10 +13,14 @@ Add your Discord ID (not name), Bot token, and update frequency to the `admin.js
```json
[]
```

Not sure, but it might be that multiline JSON doesn't work.

Start the server. If you put in everything correctly, the bot should message you on Discord.
## Compiling yourself
I developed it under Windows, and had some trouble compiling it on Linux. You mileage may vary.

## Admin commands

Start the server with `java -jar [server-file-name]` If you put in everything correctly, the bot should message you on Discord.
### Adding Servers
```
%!addChannel [channelID] [roleID/everyone]
Expand All @@ -30,7 +34,14 @@ Second argument is optional.
```
%!stop
```

### Show servers, channels and roles
```
%!info
```

These commands will work in every channel, but will be ignored if they don't come from you, however the bot will always respond in a private message.
It will also print errors directly in a Discord private message.

## TODO

Mainly reaction roles for convenience, self setup on invite to server, Twitter integration.
2 changes: 1 addition & 1 deletion src/main/kotlin/de/wulkanat/Admin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ object Admin {
)
}

fun ready() {
fun info() {
sendDevMessage(
EmbedBuilder()
.setTitle("Now watching for new Hytale Blogposts every ${updateMs / 1000}s")
Expand Down
3 changes: 3 additions & 0 deletions src/main/kotlin/de/wulkanat/Cli.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ class Cli : ListenerAdapter() {
Admin.warning("Unknown Channel ID")
}
}
"info" -> {
Admin.info()
}
}
} catch (e: ArrayIndexOutOfBoundsException) {
// noop
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/de/wulkanat/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fun main() {

Channels.jda = builder
Admin.jda = builder
Admin.ready()
Admin.info()

Runtime.getRuntime().addShutdownHook(object : Thread() {
override fun run() {
Expand Down

0 comments on commit a8babb5

Please sign in to comment.