All Projects → RealTimeChris → DiscordCoreAPI

RealTimeChris / DiscordCoreAPI

Licence: AGPL-3.0 license
A bot library for Discord, written in C++, and featuring explicit multithreading through the usage of custom, asynchronous C++ CoRoutines.

Programming Languages

C++
36643 projects - #6 most used programming language
CMake
9771 projects

Projects that are alternatives of or similar to DiscordCoreAPI

Discord.js
discord.js is a powerful Node.js module that allows you to easily interact with the Discord API.
Stars: ✭ 16,432 (+15700%)
Mutual labels:  discord-bot, discord-api, discord-server, voice-support
LenoxBot
🖥️ LenoxBot is a Discord bot that offers many cool new features to your Discord server!
Stars: ✭ 218 (+109.62%)
Mutual labels:  discord-bot, discord-api, discord-server
discord.js-modules
Modularisation of discord.js (WIP)
Stars: ✭ 210 (+101.92%)
Mutual labels:  discord-bot, discord-api, voice-support
Discord-BOT-Dashboard
This version is outdated, please check out Discord BOT Dashboard v2
Stars: ✭ 32 (-69.23%)
Mutual labels:  discord-bot, discord-api, discord-server
Nino
🔨 Advanced and cute moderation discord bot as an entry of Discord's Hack Week!
Stars: ✭ 78 (-25%)
Mutual labels:  discord-bot, discord-api
Bot
A Discord bot for all your needs. With memes, utilities, moderation & more, Fire is the only bot you'll need.
Stars: ✭ 79 (-24.04%)
Mutual labels:  discord-bot, discord-api
Discord.js Menu
💬 Easily create Discord.js v12 embed menus with reactions and unlimited customizable pages.
Stars: ✭ 89 (-14.42%)
Mutual labels:  discord-bot, discord-api
Music Bot
Simple music bot with a full-blown queue system that is easy to understand
Stars: ✭ 102 (-1.92%)
Mutual labels:  discord-bot, discord-api
Discljord
A Clojure wrapper library for the Discord API, with full API coverage (except voice, for now), and high scalability
Stars: ✭ 111 (+6.73%)
Mutual labels:  discord-bot, discord-api
Discord Panel
📊 User friendly dashboard/tool for discord bot developpers to manage servers
Stars: ✭ 116 (+11.54%)
Mutual labels:  discord-bot, discord-api
Discord-Presser-Server-Nuker
Nuke Discord Bot in Js (Beta has arrived)
Stars: ✭ 253 (+143.27%)
Mutual labels:  discord-api, discord-server
Basicbot
A basic example of a Discord Bot written in Python. (discord.py)
Stars: ✭ 73 (-29.81%)
Mutual labels:  discord-bot, discord-api
Example Bots
An example bot directory for DiscordSharpPlus library. Contains C# and VB.NET examples.
Stars: ✭ 69 (-33.65%)
Mutual labels:  discord-bot, discord-api
Swag Bot
My first ever discord bot using discord.js. The bot has a total of 77 commands, and it is capable of manipulating texts and images, analyzing data, searching information, and playing music. It has high level features like xp system, coins database, and spam detector.
Stars: ✭ 86 (-17.31%)
Mutual labels:  discord-bot, discord-api
Smorebot
SmoreBot is a fun, lightweight, multipurpose bot packed with features.
Stars: ✭ 51 (-50.96%)
Mutual labels:  discord-bot, discord-api
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 (+835.58%)
Mutual labels:  discord-bot, discord-api
Selfbot.py
selfbot.py - A python discord selfbot thats easy to install - Written using discord.py
Stars: ✭ 191 (+83.65%)
Mutual labels:  discord-bot, discord-api
Discord-BOT-Dashboard-V2
Discord BOT Dashboard V2 is made to make Discord BOT Development easy, designed to help create applications without writing a single line of code while using a user friendly Web-Dashboard!
Stars: ✭ 120 (+15.38%)
Mutual labels:  discord-api, discord-server
discordcaptcha
Verification bot for Discord
Stars: ✭ 142 (+36.54%)
Mutual labels:  discord-bot, discord-api
Deku
Multi-purpose discord bot built with discord.js
Stars: ✭ 13 (-87.5%)
Mutual labels:  discord-bot, discord-api

DiscordCoreAPI

Codacy Badge Discord Build DiscordCoreAPI Commit Activity Lines of code

Hello, and welcome to DiscordCoreAPI! This is a Discord bot library, written in C++, that leverages custom asynchronous CoRoutines, as well as a home-brew set of Https, WebSocket, and Datagram socket clients - all to deliver the utmost performance and efficiency for your bot. It uses roughly 0.1% of an Intel i7 9750h CPU to stream audio in high quality (Opus @ 48Khz, 16-bit) to a single server.

Documentation/Examples

Documentation/Examples

Discord Server

This is a link to the Discord server!

Bot Template

A template for utilizing this library.

Features

Performant

CPU Efficient

  • It only uses about 0.1% of an Intel i7 9750h to stream audio in high quality (Opus 48Khz 16-bit Stereo) to a single server.

Entire Discord API Covered

  • All of the Discord API endpoints are covered in this library, including voice communication.

Concurrent Discord API Access

Advanced Rate-Limiting System

  • Guarantees that the order in which HTTP requests are executed is the same that they were submitted in - despite being launched across different threads, while never infracting on any of the Discord API's rate-limits and while running concurrently across all of the endpoints.

Slash Commands and Buttons

Select Menus

User Commands

Message Commands

Modal Text Inputs

A Unified "Input-Event" System

  • User interactions (Application Commands, Message Commands, User Commands) are accepted via the DiscordCoreAPI::EventManager::onInputEventCreation event.
  • They can all be responded to using the DiscordCoreAPI::InputEvents::respondToInputEvent() function.
  • Alternatively you can implement your own input-event handling by using the raw DiscordCoreAPI::EventManager::onInteractionCreation or DiscordCoreAPI::EventManager::onMessageCreation events.
DiscordCoreAPI::EmbedData newEmbed{};
newEmbed.setAuthor(args.eventData.getUserName(), args.eventData.getAvatarURL());
newEmbed.setDescription("------\\n__**Sorry, but there's already something playing!**__\\n------");
newEmbed.setTimeStamp(getTimeAndDate());
newEmbed.setTitle("__**Playing Issue:**__");
newEmbed.setColor(discordGuild.data.borderColor);
DiscordCoreAPI::RespondToInputEventData dataPackage{ args.eventData };
dataPackage.addMessageEmbed(newEmbed);
dataPackage.setResponseType(DiscordCoreAPI::InputEventResponseType::Ephemeral_Interaction_Response);
DiscordCoreAPI::InputEventData newEvent = DiscordCoreAPI::InputEvents::respondToInputEvent(dataPackage);
DiscordCoreAPI::InputEvents::deleteInputEventResponseAsync(newEvent, 20000).get();

Supported Platforms

  • This library currently supports being built within Visual Studio 2022/MSVC on the Windows platform as well as g++ 11 on the Linux platform.

Build Instructions (Full-Vcpkg)

  • Install vcpkg, if need be.
  • Make sure to run vcpkg integrate install.
  • Enter within a terminal vcpkg install discordcoreapi:x64-windows_OR_linux.
  • Set up a console project in your IDE and make sure to set the C++ standard to C++20 or later - and include discordcoreapi/Index.hpp.
  • Build and run!

Dependencies

  • CMake (Version 3.20 or greater)
  • NOTE: I installed these using the vcpkg installer.
  • FFMPEG (.\vcpkg install ffmpeg:x64-windows_OR_linux)
  • Nlohmann Json (.\vcpkg install nlohmann-json:x64-windows_OR_linux)
  • OpenSSL (.\vcpkg install openssl:x64-windows_OR_linux)
  • Opus (.\vcpkg install opus:x64-windows_OR_linux)
  • Sodium (.\vcpkg install libsodium:x64-windows_OR_linux)

Build Instructions (Non-Vcpkg) - The Library

  • Install the dependencies.
  • Clone this git repository into a folder.
  • Set, in CMakeLists.txt, the <DEPENDENCY>_INCLUDE_DIR, <DEPENDENCY>_DEBUG_ROOT and <DEPENDENCY>_RELEASE_ROOT paths to wherever each of the respective dependencies are located - setting the <DEPENDENCY>_DEBUG_ROOT folder to wherever the debug version of the .lib file is, the <DEPENDENCY>_RELEASE_ROOT folder to wherever the release version of the .lib file for the library is, and the <DEPENDENCY>_INCLUDE_DIR to whichever directory contains the public headers for the library.
  • Open a terminal inside the git repo's folder.
  • Run cmake -S . --preset Linux_OR_Windows-Debug_OR_Release.
  • Then run cmake --build --preset Linux_OR_Windows-Debug_OR_Release.
  • Run within the same terminal and folder cmake --install ./Build/Debug_OR_Release.
  • The default installation paths are: Windows = "ROOT_DRIVE:/Users/USERNAME/CMake/DiscordCoreAPI", Linux = "/home/USERNAME/CMake/DiscordCoreAPI"

The CMAKE Package

  • By running cmake --install ./Build/Debug_OR_Release, you will be given a cmake package, which can be used to build from this library, using other cmake projects.
  • It is used by setting DiscordCoreAPI_DIR to wherever the DiscordCoreAPIConfig.cmake file would have been installed on your system by having run the cmake --install command, and then using find_package() on DiscordCoreAPI.
  • When found, you will be granted the following cmake "variables"; DiscordCoreAPI::DiscordCoreAPI - this is the library target which can be linked to from other targets in cmake, and on Windows; $<TARGET_RUNTIME_DLLS:DiscordCoreAPI-Bot> - which is a list of dll files to be copied into your executable's final location after building. As well as RELEASE_PDB_FILE_PATH, DEBUG_PDB_FILE_PATH, RELEASE_PDB_FILE_NAME, and DEBUG_PDB_FILE_NAME, which are full file/directory paths/filenames to the library's PDB files.
  • Here and here is an example of building an executable from this library with this method.

Build Instructions (Non-Vcpkg) - The Executable

  • Download the bot template or create your own with the same imports, and set within it either the path to the vcpkg base-directory, or the path to the DiscordCoreAPIConfig.cmake file that was created by the installation process before this and the same <DEPENDENCY>_INCLUDE_DIR, <DEPENDENCY>_DEBUG_ROOT and <DEPENDENCY>_RELEASE_ROOT values as before.
  • Download, install and run these following scripts after the call to project() but before trying to find the DiscordCoreAPI package. Such as here, and here.
  • Set up a main.cpp like this one, including the header discordcoreapi/Index.hpp.
  • Run in a terminal from within the same folder as the top-level CMakeLists.txt, cmake -S . --preset Linux_OR_Windows-Debug_OR_Release.
  • Then run cmake --build --preset Linux_OR_Windows-Debug_OR_Release.
  • Run within the same terminal and folder cmake --install ./Build/Debug_OR_Release.
  • The default installation paths are: Windows = "ROOT_DRIVE:/Users/USERNAME/CMake/Bot-Template-For-DiscordCoreAPI", Linux = "/home/USERNAME/CMake/Bot-Template-For-DiscordCoreAPI"

Roadmap

I am currently working on getting this thing to be used by people like you! So, if you have any suggestions for the library that would make it more usable - don't hesitate to let me know! I can be easily found on the Discord server that is linked to above! Cheers and thanks for your time.

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].