Coder Social home page Coder Social logo

Lispcord -- A wrapper for the DiscordApp WEB-API

Lispcord aims to make it freakishly easy to build bots for Discord.

The examples folder contains some more ideas on how to get started :)

NOTE: this is not even an alpha quality software

A lot of the api is changing rapidly, use at own risk!

NOTE: recently we axed the Pipe system

Please re-adjust your bots to use the new API going forwards. As it turned out, the pipes worked well for small bots but had the penchant to bloat in complexity rather quickly, and weren't particularly fast :D

Ping bot

This assumes that :lispcord has been loaded in your image. If not, try running

(ql:quickload :lispcord)

after cloning the repo to your ~/common-lisp or ~/quicklisp/local-projects folder.

(defpackage :ping-bot
  (:use :cl :lispcord))
(in-package :ping-bot)

(setf (org.shirakumo.verbose:repl-level) :info)

(defbot *ping-bot* "<Your Token Here>")
(connect *ping-bot*) ; Yes, you can register handlers after connect

(add-event-handler :on-message-create
  (lambda (msg) (if (string= (lc:content msg) "ping!") (reply msg "pong!"))))

Unlike many other libraries, lispcord is capable of running an arbitrary amount of client-instances at the same time.
Every (non-cache related) function takes an optional "bot" parameter, either via keyword or as an anonymous optional, with which you can specify what instance should execute the action.

For convenience, however, lispcord also defines a dynamic *CLIENT* which gets automatically bound to the last instance defined via DEFBOT. This allows you to:

  • drop having to specifiy the bot for 1-instance scripts
  • use LET to override the global, and create local 1-instance spaces

lispcord's Projects

lispcord icon lispcord

A client library for the discordapp bot api

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.