Skip to content

Billzabob/dissonance

Repository files navigation

Dissonance

A Discord framework for Scala

// available for 2.12, 2.13
libraryDependencies += "com.github.billzabob" %% "dissonance" % "version"

Example

import cats.effect._
import dissonance.data._
import dissonance.data.events._
import dissonance.Discord

object Main extends IOApp {
  override def run(args: List[String]): IO[ExitCode] =
    Discord.make(args.head).use { discord =>
      discord
        .subscribe(Shard.singleton, Intent.GuildMessages)
        .evalMap {
          case MessageCreate(BasicMessage(_, "ping", _, channelId)) =>
            discord.client.sendMessage("pong", channelId).void
          case _ => IO.unit
        }
        .compile
        .drain
        .as(ExitCode.Success)
    }
}

About

A Discord framework for Scala

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages