Giter Club home page Giter Club logo

dab's Introduction

NOTE: I moved to Rust while developing this bot. See https://github.com/Sir-Photch/dab-rs

DAB-icon

DAB - Discord Announcement Bot

Bot that lets users /chime with a given audio-file or url, that plays each time they connect to a channel on your server.

Features

Slash-commands

/chime set url    # sets chime of user to given url (that links to a audio-file)
/chime set file   # sets chime of user to given attachment
/chime clear      # clears chime of user, if present

Behaviour

If some user connects to a channel, the bot will join that channel and play the chime of the user, if configured. After playing, the bot will leave.

When multiple users connect at the same time, their chimes will be queued and played in first come, first serve-order.

How to get started

Clone this repo and build it for your platform, or download the current release. Consider dependencies needed to run.

On first startup, the bot will exit stating that a default-config has been created. You need to add your Discord-API-Key in config.json.

Configuration

The auto-generated config.json in the working directory of the bot contains various parameters that can be adjusted. Currently, the config consists of:

{
  "DiscordParams": {
    "ApiKey": "foo bar baz",
    "AudioBufferMs": 25
  },
  "BotParams": {
    "ChimeDurationMaxMs": 10000,
    "ChimeFilesizeMaxKb": 5000,
    "ChimePlaybackTimeoutMs": 10000
  }
}
  • "ApiKey": string containing your unique discord-api-token
  • "AudioBufferMs": unsigned integer containing the buffer-duration of discord-audio-stream. Must be greater than 1. For bigger values, short chimes may not be played.
  • "ChimeDurationMaxMs": signed integer containing the maximum duration of a chime, in milliseconds. For no limit, set -1.
  • "ChimeFilesizeMaxKb": signed integer containing the maximum filesize a user can upload, in kilobytes. For no limit, set -1.
  • "ChimePlaybackTimeoutMs": signed integer containing the maximum duration after playing a chime will time out, in milliseconds. This is recommended to be set. For no limit, set -1

In general, the default settings will work out most of the time.

Known issues

  • playback stutters on weaker machines
  • Chimes are queued when bot is in other channel than joinee, but not played until some other user joins into the same channel

Contributing

Kudos to you for scrolling this far! If you want to contribute, see CONTRIBUTING.md.

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.