All Projects → krisppurg → Dimscord

krisppurg / Dimscord

Licence: mit
A Discord Bot & REST Library for Nim.

Programming Languages

nim
578 projects

Projects that are alternatives of or similar to Dimscord

Aegis.cpp
Discord C++ library for interfacing with the API. Join our server:
Stars: ✭ 198 (+195.52%)
Mutual labels:  api, discord-api, discord
Discord4j
Discord4J is a fast, powerful, unopinionated, reactive library to enable quick and easy development of Discord bots for Java, Kotlin, and other JVM languages using the official Discord Bot API.
Stars: ✭ 973 (+1352.24%)
Mutual labels:  api, discord-api, discord
Basicbot
A basic example of a Discord Bot written in Python. (discord.py)
Stars: ✭ 73 (+8.96%)
Mutual labels:  api, discord-api, discord
Discordeno
Discord API library for Deno
Stars: ✭ 254 (+279.1%)
Mutual labels:  api, discord-api, discord
Disgord
Go module for interacting with the documented Discord's bot interface; Gateway, REST requests and voice
Stars: ✭ 277 (+313.43%)
Mutual labels:  api, discord-api, discord
Lightcord
A simple - customizable - Discord Client
Stars: ✭ 366 (+446.27%)
Mutual labels:  discord-api, discord, client
Javacord
An easy to use multithreaded library for creating Discord bots in Java.
Stars: ✭ 368 (+449.25%)
Mutual labels:  api, discord-api, discord
Dsharpplus
A .NET Standard library for making bots using the Discord API.
Stars: ✭ 635 (+847.76%)
Mutual labels:  api, discord-api, discord
Vainglory
(*DEPRECATED*: The API no longer exists, so this will no longer work) A Javascript API Client wrapper for Vainglory
Stars: ✭ 32 (-52.24%)
Mutual labels:  api, client
Igdb
Go client for the Internet Game Database API
Stars: ✭ 65 (-2.99%)
Mutual labels:  api, client
Coward
🐔 Coward is a Deno module for easy interaction with the Discord API.
Stars: ✭ 65 (-2.99%)
Mutual labels:  discord-api, discord
Modmail
A feature rich discord Modmail bot
Stars: ✭ 957 (+1328.36%)
Mutual labels:  discord-api, discord
Discpp
Simplified, but feature rich Discord API wrapper written in modern C++.
Stars: ✭ 31 (-53.73%)
Mutual labels:  discord-api, discord
Discord Bot
🤖 Our BIG help in things about moderation and many more useful stuff on our Discord server.
Stars: ✭ 30 (-55.22%)
Mutual labels:  api, discord
Nineapi
Unofficial python client library for *official* 9GAG API. (alpha)
Stars: ✭ 43 (-35.82%)
Mutual labels:  api, client
Gochimp3
🐒 Golang client for MailChimp API 3.0.
Stars: ✭ 39 (-41.79%)
Mutual labels:  api, client
Eris
A NodeJS Discord library
Stars: ✭ 879 (+1211.94%)
Mutual labels:  discord-api, discord
Discord Global Mutual
Get the list of people that you have shared servers with
Stars: ✭ 39 (-41.79%)
Mutual labels:  discord-api, discord
Https
Secure HTTP client with SSL pinning for Nativescript - iOS/Android
Stars: ✭ 45 (-32.84%)
Mutual labels:  api, client
Dscord
Discord Library for D
Stars: ✭ 52 (-22.39%)
Mutual labels:  discord-api, discord

Dimscord

A Discord Bot & REST Library for Nim. Discord API Channel

Why Dimscord?

  • It is minimalistic and efficient.
  • Nim is a good programming language and I believe that Nim should stand a chance on having an up-to-date, substantial discord library.
  • It has a REST-mode only feature, which isn't cache-reliant.
  • The other Nim Discord library (discordnim) has bunch of issues, and it's unmaintained.

FAQ:

  • What is Nim?
  • Why use Nim for Discord bots?
    • Since it's easier to learn, it's faster than any other interpreted languages, which is beneficial for the performance of larger discord bots. You can read the Nim FAQ here
  • Is there a command handler for Dimscord?
    • Yes, but not in this library.

Getting Started:

  1. Install Nim using choosenim or Nim's website

  2. Install Dimscord via Nimble using nimble install dimscord or GitHub git clone https://github.com/krisppurg/dimscord

    • You will need at least Nim 1.2.0 to install dimscord
  3. Read the Wiki or Examples for referencing. Maybe even rewrite your bot if you want to switch.

  4. Start coding! Stay up-to-date with the latest Dimscord release and stuff.

Quick Example:

import dimscord, asyncdispatch, times, options

let discord = newDiscordClient("<your bot token goes here>")

# Handle event for on_ready.
proc onReady(s: Shard, r: Ready) {.event(discord).} =
    echo "Ready as " & $r.user

# Handle event for message_create.
proc messageCreate(s: Shard, m: Message) {.event(discord).} =
    if m.author.bot: return
    if m.content == "!ping": # If message content is "!ping".
        let
            before = epochTime() * 1000
            msg = await discord.api.sendMessage(m.channel_id, "ping?")
            after = epochTime() * 1000
        # Now edit the message.
        # Use 'discard' because editMessage returns a new message.
        discard await discord.api.editMessage(
            m.channel_id,
            msg.id, 
            "Pong! took " & $int(after - before) & "ms | " & $s.latency() & "ms."
        )
    elif m.content == "!embed": # Otherwise if message content is "!embed".
        # Sends a message with embed.
        discard await discord.api.sendMessage(
            m.channel_id,
            embed = some Embed(
                title: some "Hello there!", 
                description: some "This is description",
                color: some 0x7789ec
            )
        )

# Connect to Discord and run the bot.
waitFor discord.startSession()

Please ensure that when you are running your Discord bot you define -d:ssl example: nim c -r -d:ssl main.nim, you can use -d:dimscordDebug, if you want to debug.

If you want to use voice then you can use -d:dimscordVoice (This requires libsodium.dll/so to be accessible)

Contributing

  • If you are interested in contributing to Dimscord, I'd recommend reading the CONTRIBUTING.md file.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].