mirror of
https://github.com/HappyTanuki/BumbleCee.git
synced 2025-10-26 01:45:15 +00:00
중간저장(다시 큐 방식으로 돌아가되, 실시간 스트리밍 방식으로 비동기 처리를 구현할 것임)
This commit is contained in:
71
include/BumbleBee.hpp
Normal file
71
include/BumbleBee.hpp
Normal file
@@ -0,0 +1,71 @@
|
||||
#pragma once
|
||||
#ifndef _BUMBLEBEE_HPP_
|
||||
#define _BUMBLEBEE_HPP_
|
||||
#include <dpp/dpp.h>
|
||||
#include <dpp/nlohmann/json.hpp>
|
||||
#include <boost/asio.hpp>
|
||||
#include <memory>
|
||||
#include <BumbleBeeCommand.hpp>
|
||||
#include <MusicQueue.hpp>
|
||||
#include <mariadb/conncpp.hpp>
|
||||
|
||||
namespace bumbleBee {
|
||||
/**
|
||||
* @file BumbleBee.hpp
|
||||
* @brief 메인 봇 클래스
|
||||
**/
|
||||
class BumbleBee {
|
||||
public:
|
||||
/**
|
||||
* @fn BumbleBee(nlohmann::json settings)
|
||||
* @brief 생성자
|
||||
* @param settings 설정 json
|
||||
**/
|
||||
BumbleBee(nlohmann::json settings);
|
||||
/**
|
||||
* @fn ~BumbleBee()
|
||||
* @brief 파괴자
|
||||
* @details BumbleBee의 모든 Property를 책임지고 파괴합니다
|
||||
**/
|
||||
~BumbleBee();
|
||||
|
||||
/**
|
||||
* @fn void start()
|
||||
* @brief 봇 시작
|
||||
**/
|
||||
void start();
|
||||
/**
|
||||
* @fn bool addCommand(commands::ICommand cmd)
|
||||
* @brief ICommand 인터페이스에 맞는 커맨드를 추가
|
||||
* @warning 이 메소드는 start()메소드가 호출되기 전에 호출되어야 함
|
||||
**/
|
||||
bool addCommand(commands::ICommand cmd);
|
||||
|
||||
/**
|
||||
* @fn void on_slashcommand(const dpp::slashcommand_t& event)
|
||||
* @brief slashcommand 이벤트 인지시 콜백되는 함수
|
||||
* @param event
|
||||
**/
|
||||
void on_slashcommand(const dpp::slashcommand_t& event);
|
||||
/**
|
||||
* @fn void on_ready(const dpp::ready_t &event)
|
||||
* @brief ready 이벤트 인지시 콜백되는 함수
|
||||
* @param event
|
||||
**/
|
||||
void on_ready(const dpp::ready_t &event);
|
||||
private:
|
||||
/// @brief DPP 기본 클러스터 객체
|
||||
std::unique_ptr<dpp::cluster> cluster;
|
||||
/// @brief db 드라이버
|
||||
sql::Driver* dbDriver;
|
||||
/// @brief db 접속 URL
|
||||
std::shared_ptr<sql::SQLString> dbURL;
|
||||
/// @brief db 접속 속성
|
||||
std::shared_ptr<sql::Properties> dbProperties;
|
||||
/// @brief Command 목록
|
||||
std::vector<commands::ICommand> commands;
|
||||
/// @brief 음악 큐
|
||||
std::shared_ptr<MusicQueue> queue;
|
||||
};
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user