#include <dpp/dpp.h>
#include <fmt/format.h>
#include <iomanip>
#include <sstream>
int main(int argc, char const *argv[])
{
uint8_t* robot = nullptr;
size_t robot_size = 0;
std::ifstream input ("../testdata/Robot.pcm", std::ios::in|std::ios::binary|std::ios::ate);
if (input.is_open()) {
robot_size = input.tellg();
robot = new uint8_t[robot_size];
input.seekg (0, std::ios::beg);
input.read ((char*)robot, robot_size);
input.close();
}
std::string command;
ss >> command;
if (command == ".join") {
bot.message_create(
dpp::message(channel_id,
"You don't seem to be on a voice channel! :("));
}
}
if (command == ".robot") {
}
}
});
bot.start(false);
return 0;
}
bool IsReady()
voice client is ready to stream audio. The voice client is considered ready if it has a secret key.
void SendAudio(uint16_t *audio_data, const size_t length, bool use_opus=true)
Send audio to the voice channel.
The cluster class represents a group of shards and a command queue for sending and receiving commands...
Definition: cluster.h:154
Represents a guild on Discord (AKA a server)
Definition: guild.h:85
bool ConnectMemberVoice(snowflake user_id)
Connect to a voice channel another guild member is in.
snowflake id
Definition: discord.h:44
Represents a connection to a voice channel. A client can only connect to one voice channel per guild ...
Definition: discordclient.h:49
class DiscordVoiceClient * voiceclient
voice websocket client
Definition: discordclient.h:78
guild * find_guild(snowflake id)
Create message.
Definition: dispatcher.h:617
message * msg
Definition: dispatcher.h:623
Represents messages sent and received on Discord.
Definition: message.h:517
user * author
Definition: message.h:525
snowflake guild_id
Definition: message.h:523
std::string content
Definition: message.h:529