Newer
Older
yuyuko-bot / src / main / scala / GensokyoBot.scala
@Dale TwoKey Dale TwoKey on 23 Aug 2021 691 bytes misc: Initial commit
package social.gensokyo.discordbot

import listeners.Reactions

import ackcord._
import slick.jdbc.JdbcBackend.Database

import scala.concurrent.ExecutionContext.Implicits.global

class GensokyoBot(token: String)(implicit db: Database) {
  val clientSettings: ClientSettings = ClientSettings(token)
  clientSettings.createClient().map(client => {
    client.onEventSideEffectsIgnore {
      case APIMessage.Ready(_) => println("Now Ready")
      case _ =>
    }
    val reactionListeners = new Reactions(client.requests)(client)
    client.registerListener(reactionListeners.onUserReactAddRole)
    client.registerListener(reactionListeners.onUserReactRemoveRole)
    client.login();
  })
}