FoofyFox Sandstorm 2
General-purpose Discord bot in C++
ffss::SSMsgVoice Class Reference

Public Member Functions

void connect (dpp::cluster &bot, const dpp::message_create_t &ev)
 Connects the bot to a voice channel that the user requesting is in. More...
 
void disconnect (dpp::cluster &bot, const dpp::message_create_t &ev)
 Disconnects the bot to a voice channel that the user requesting is in. More...
 
void play (dpp::cluster &bot, const dpp::message_create_t ev, const std::string &pcm_name, const std::string &pcm_data)
 Play a new track. More...
 
size_t get_tracks_remaining (const dpp::message_create_t &ev)
 Get the number of tracks remaining in the queue of the requesting user's server. More...
 
void skip (const dpp::message_create_t &ev)
 Skip to the next track. More...
 
void stop (const dpp::message_create_t &ev)
 Clear the track queue. More...
 
void pause (const dpp::message_create_t &ev)
 Pause the track queue. More...
 
void resume (const dpp::message_create_t &ev)
 Resume the track queue. More...
 

Member Function Documentation

◆ connect()

void ffss::SSMsgVoice::connect ( dpp::cluster &  bot,
const dpp::message_create_t &  ev 
)

Connects the bot to a voice channel that the user requesting is in.

Parameters
bota reference to a cluster.
eva reference to the event the user generated.

Documented preconditions are as follows:

  • The user must be in a voice channel.

◆ disconnect()

void ffss::SSMsgVoice::disconnect ( dpp::cluster &  bot,
const dpp::message_create_t &  ev 
)

Disconnects the bot to a voice channel that the user requesting is in.

Parameters
bota reference to a cluster.
eva reference to the event the user generated.

Documented preconditions are as follows:

  • The bot must be in a voice channel.
    Exceptions
    std::runtime_errorif the bot is not in a voice channel or the voice state is otherwise erroneous.

◆ get_tracks_remaining()

size_t ffss::SSMsgVoice::get_tracks_remaining ( const dpp::message_create_t &  ev)

Get the number of tracks remaining in the queue of the requesting user's server.

Parameters
eva reference to the event the user generated.

Documented preconditions are as follows:

  • The bot must be in a voice channel.
    Returns
    The number of tracks remaining.

◆ pause()

void ffss::SSMsgVoice::pause ( const dpp::message_create_t &  ev)

Pause the track queue.

Parameters
eva reference to the event the user generated.

Documented preconditions are as follows:

  • The bot must be in a voice channel.
  • There must be at least one track playing.

◆ play()

void ffss::SSMsgVoice::play ( dpp::cluster &  bot,
const dpp::message_create_t  ev,
const std::string &  pcm_name,
const std::string &  pcm_data 
)

Play a new track.

Parameters
bota reference to a cluster.
eva reference to the event the user generated.
pcm_namethe name of the track.
pcm_datathe raw PCM data of the track.

Documented preconditions are as follows:

  • The bot must be in a voice channel.
  • pcm_data is valid PCM data.
    Exceptions
    std::runtime_errorif there is an erroneous state in the object, which would likely be a developer bug.

◆ resume()

void ffss::SSMsgVoice::resume ( const dpp::message_create_t &  ev)

Resume the track queue.

Parameters
eva reference to the event the user generated.

Documented preconditions are as follows:

  • The bot must be in a voice channel.
  • There must be at least one track playing.

◆ skip()

void ffss::SSMsgVoice::skip ( const dpp::message_create_t &  ev)

Skip to the next track.

Parameters
eva reference to the event the user generated.

Documented preconditions are as follows:

  • The bot must be in a voice channel.
  • There must be at least one track playing.

◆ stop()

void ffss::SSMsgVoice::stop ( const dpp::message_create_t &  ev)

Clear the track queue.

Parameters
eva reference to the event the user generated.

Documented preconditions are as follows:

  • The bot must be in a voice channel.
  • There must be at least one track playing.

The documentation for this class was generated from the following files: