Kotlin command line application to handle CodeMarathon 2.0.
- Install latest IntelliJ IDEA Community Edition (2017.2.6).
- Clone cm2 repo to your computer, type
clone git@github.com:evgenii-kanivets/cm2.git
in your command line. - Open the project through IntelliJ IDEA.
- Run 'MainKt', there are must to be errors in console. This is because of credentials you need to access Firebase Database and Telegram Chat.
- Contact
Evgenii Kanivets
to get credentials.
- Place .json into project folder.
- Update
FirebaseClient.kt
to locate your credentials:
init {
val serviceAccount = FileInputStream("codemarathon-2-dev-firebase-adminsdk.json")
val options = FirebaseOptions.Builder()
.setCredential(FirebaseCredentials.fromCertificate(serviceAccount))
.setDatabaseUrl("https://codemarathon-2-dev.firebaseio.com")
.build()
FirebaseApp.initializeApp(options)
}
- Update
TelegramBot.kt
with your bot access token:
private val retrofit by lazy {
Retrofit.Builder().baseUrl("https://api.telegram<token>.org/bot/") // Insert Telegram Bot token here
.build()
}