mirror of
https://github.com/HappyTanuki/BumbleCee.git
synced 2025-10-26 01:45:15 +00:00
join, play 구현
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
#include <Bot.hpp>
|
||||
#include <iostream>
|
||||
|
||||
void IBot::test() {
|
||||
std::cout << "작동함";
|
||||
}
|
||||
@@ -1,9 +1,19 @@
|
||||
#pragma once
|
||||
#include "CommandType.hpp"
|
||||
#include <dpp/dpp.h>
|
||||
#include <memory>
|
||||
|
||||
class IBot{
|
||||
class IBot {
|
||||
private:
|
||||
public:
|
||||
void test();
|
||||
IBot(std::string Token);
|
||||
void AddCommand(ICommand &Command);
|
||||
void Start();
|
||||
|
||||
std::shared_ptr<dpp::cluster> bot;
|
||||
protected:
|
||||
virtual void OnReady(const dpp::ready_t& event);
|
||||
virtual void OnCommand(const dpp::slashcommand_t& event);
|
||||
|
||||
std::vector<ICommand*> CommandsArray;
|
||||
};
|
||||
@@ -1,2 +0,0 @@
|
||||
#include <BumbleCee.hpp>
|
||||
#include <iostream>
|
||||
@@ -1,15 +0,0 @@
|
||||
#pragma once
|
||||
#include <Bot.hpp>
|
||||
|
||||
class BumbleCee : public IBot {
|
||||
public:
|
||||
static BumbleCee* getInstance() {
|
||||
static BumbleCee instance;
|
||||
return &instance;
|
||||
}
|
||||
protected:
|
||||
private:
|
||||
BumbleCee() {}
|
||||
BumbleCee(const BumbleCee& ref) {}
|
||||
~BumbleCee() {}
|
||||
};
|
||||
20
include/BumbleCeepp.hpp
Normal file
20
include/BumbleCeepp.hpp
Normal file
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
#include "Bot.hpp"
|
||||
#include <string>
|
||||
#include <list>
|
||||
|
||||
class BumbleCeepp : public IBot {
|
||||
public:
|
||||
static BumbleCeepp* GetInstance(std::string Token) {
|
||||
static BumbleCeepp Instance(Token);
|
||||
return &Instance;
|
||||
}
|
||||
void enqueue(std::string);
|
||||
std::string dequeue();
|
||||
protected:
|
||||
std::list<std::string> MusicQueue;
|
||||
private:
|
||||
BumbleCeepp(std::string Token);
|
||||
|
||||
void OnCommand(const dpp::slashcommand_t& Event);
|
||||
};
|
||||
12
include/CommandType.hpp
Normal file
12
include/CommandType.hpp
Normal file
@@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
#include <dpp/dpp.h>
|
||||
#include <vector>
|
||||
#include <list>
|
||||
|
||||
class ICommand {
|
||||
public:
|
||||
virtual void operator() (const dpp::slashcommand_t& Event) = 0;
|
||||
virtual void operator() (std::list<std::string>& MusicQueue, const dpp::slashcommand_t& Event) = 0;
|
||||
|
||||
std::vector<dpp::slashcommand> CommandObjectVector;
|
||||
};
|
||||
4
include/Commands.hpp
Normal file
4
include/Commands.hpp
Normal file
@@ -0,0 +1,4 @@
|
||||
#pragma once
|
||||
#include "Commands/Play.hpp"
|
||||
#include "Commands/Queue.hpp"
|
||||
#include "Commands/Join.hpp"
|
||||
10
include/Commands/Join.hpp
Normal file
10
include/Commands/Join.hpp
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
#include "../CommandType.hpp"
|
||||
|
||||
class Join : public ICommand {
|
||||
public:
|
||||
Join(dpp::snowflake Id);
|
||||
|
||||
void operator()(const dpp::slashcommand_t& Event) {}
|
||||
void operator()(std::list<std::string>& MusicQueue, const dpp::slashcommand_t& Event);
|
||||
};
|
||||
10
include/Commands/Play.hpp
Normal file
10
include/Commands/Play.hpp
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
#include "../CommandType.hpp"
|
||||
|
||||
class Play : public ICommand {
|
||||
public:
|
||||
Play(dpp::snowflake Id);
|
||||
|
||||
void operator()(const dpp::slashcommand_t& Event) {}
|
||||
void operator()(std::list<std::string>& MusicQueue, const dpp::slashcommand_t& Event);
|
||||
};
|
||||
10
include/Commands/Queue.hpp
Normal file
10
include/Commands/Queue.hpp
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
#include "../CommandType.hpp"
|
||||
|
||||
class Queue : public ICommand {
|
||||
public:
|
||||
Queue(dpp::snowflake Id);
|
||||
|
||||
void operator()(const dpp::slashcommand_t& Event) {}
|
||||
void operator()(std::list<std::string>& MusicQueue, const dpp::slashcommand_t& Event);
|
||||
};
|
||||
Reference in New Issue
Block a user