#include <dpp/dpp.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;
}
The cluster class represents a group of shards and a command queue for sending and receiving commands...
Definition: cluster.h:384
discord_voice_client & send_audio_raw(uint16_t *audio_data, const size_t length)
Send raw audio to the voice channel.
bool is_ready()
voice client is ready to stream audio. The voice client is considered ready if it has a secret key.
Represents a guild on Discord (AKA a server)
Definition: guild.h:358
bool connect_member_voice(snowflake user_id, bool self_mute=false, bool self_deaf=false)
Connect to a voice channel another guild member is in.
snowflake id
Unique ID of object set by Discord. This value contains a timestamp, worker ID, internal server ID,...
Definition: discord.h:48
Represents a connection to a voice channel. A client can only connect to one voice channel per guild ...
Definition: discordclient.h:60
class discord_voice_client * voiceclient
voice websocket client
Definition: discordclient.h:89
DPP_EXPORT guild * find_guild(snowflake id)
Create message.
Definition: dispatcher.h:1156
message msg
message that was created (sent).
Definition: dispatcher.h:1165
Represents messages sent and received on Discord.
Definition: message.h:1010
user author
Definition: message.h:1016
snowflake guild_id
Definition: message.h:1014
std::string content
Definition: message.h:1020