discord.clj is a Clojure wrapper around the Discord APIs. The overall goal of this library to painlessly facilitate the creation of bots and custom bot extensions within Clojure.
This library seeks to abstract most of the complexity out of the Discord API and gateway protocols. While many of the underlying implementation protocols are available for extension should the need arise, it is the goal of this library that most things should Just Work:tm: out of the box.
The library is available on Clojars here. You can install it using any of the following methods:
Leiningen/Boot:
[discord.clj "2.0.0"]
Clojure CLI/deps.edn:
discord.clj {:mvn/version "2.0.0"}
Gradle:
compile 'discord.clj:discord.clj:2.0.0'
Maven:
<dependency>
<groupId>discord.clj</groupId>
<artifactId>discord.clj</artifactId>
<version>2.0.0</version>
</dependency>
To get started running a Discord bot, you'll want to do the following:
resources/bot-config.edn
file.resources/bot-config.edn
file as well.[:guilds :guild-messages :direct-messages]
lein run
!At this point, your bot-config.edn
file should look similar to this
template.
In addition to the builtin commands, this project also ships with
a series of examples that you can include on startup. For example, to include the
echo_prefix
command example, run the following command within the repo:
lein run -e examples/echo_prefix
You can create a standalone JAR file for this by running the following:
$ lein uberjar
$ java -jar ./target/uberjar/discord.clj-2.0.0-standalone.jar
To run the core namespace which contains a basic bot framework, you can run the following:
$ lein run
Copyright © 2017-2021 Christopher Chapline
Distributed under the MIT License.