Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/UADAF/UADAB-2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rootofundefined committed Aug 15, 2020
2 parents dce5d13 + 54743bf commit 90ea657
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 8 deletions.
36 changes: 36 additions & 0 deletions bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env python3

import os
import sys
import subprocess

from sys import argv
from os.path import exists

def write_pid_file(pid):
with open("pidfile", "w+") as pidfile:
pidfile.write(str(pid))

def remove_pid_file():
if exists("pidfile"):
os.remove("pidfile")

if len(argv) < 2:
print("Not enough arguments. You need to specify bot location")
sys.exit(1)

if not exists(argv[1]):
print(f"File {argv[1]} does not exists")
sys.exit(2)

bot = argv[1]
with open("bot.log", "w+b") as bot_out:
with subprocess.Popen(["java", "-jar", bot], stdout=bot_out, stderr=bot_out) as process:
print("process started with pid", process.pid)
write_pid_file(process.pid)
try:
process.wait()
except KeyboardInterrupt:
print("bootstrap has been killed by keyboard interrupt, stopping bot...")
print("process has been terminated with code", process.returncode)
remove_pid_file()
17 changes: 9 additions & 8 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

group = "com.gt22"
version = "2.0-SNAPSHOT"
version = "2.2"

repositories {
mavenCentral()
Expand All @@ -16,24 +16,25 @@ repositories {
maven { url = uri("https://dl.bintray.com/kotlin/ktor") }
}
val jdaVersion = "3.8.3_462"
val gsonVersion = "2.8.5"
val ktorVersion = "1.2.1"
val gsonVersion = "2.8.6"
val ktorVersion = "1.2.6"

dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.8")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.3.8")
implementation("net.dv8tion:JDA:$jdaVersion")
implementation("com.google.code.gson:gson:$gsonVersion")
implementation("org.slf4j:slf4j-simple:1.7.25")
implementation("org.slf4j:slf4j-simple:1.7.30")
implementation("de.codecentric.centerdevice:javafxsvg:1.3.0")
implementation("io.ktor:ktor-client-core:$ktorVersion")
implementation("io.ktor:ktor-client-apache:$ktorVersion")
implementation("org.jetbrains.exposed:exposed:0.10.4")
implementation("mysql:mysql-connector-java:6.0.6")
implementation("com.github.kizitonwose.time:time:1.0.2")
implementation("org.jetbrains.exposed:exposed:0.17.7")
implementation("mysql:mysql-connector-java:8.0.21")
implementation("com.github.kizitonwose.time:time:1.0.4")
implementation("com.uadaf:uadamusic:2.5")
implementation("com.uadaf:quoter-api:1.3.1")
implementation("com.sedmelluq:lavaplayer:1.3.12")
implementation("com.sedmelluq:lavaplayer:1.3.47")
implementation("pl.droidsonroids:jspoon:1.3.2")
testImplementation("junit:junit:4.12")
}
Expand Down

0 comments on commit 90ea657

Please sign in to comment.