#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:447
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:368
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: managed.h:38
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
std::function< void(const dpp::log_t &)> DPP_EXPORT cout_logger()
Get a default logger that outputs to std::cout. e.g.
@ i_message_content
Intent for receipt of message content.
Definition: intents.h:64
@ i_default_intents
Default D++ intents (all non-privileged intents)
Definition: intents.h:68
DPP_EXPORT class guild * find_guild(snowflake id)
Create message.
Definition: dispatcher.h:1180
message msg
message that was created (sent).
Definition: dispatcher.h:1189
Represents messages sent and received on Discord.
Definition: message.h:1036
user author
Definition: message.h:1042
snowflake guild_id
Definition: message.h:1040
std::string content
Definition: message.h:1046