Skip to content

Commit

Permalink
[change] change constant storage format
Browse files Browse the repository at this point in the history
  • Loading branch information
rockcutter committed Sep 17, 2022
1 parent 14dadf0 commit 7b85306
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 22 deletions.
12 changes: 6 additions & 6 deletions src/module/timer/timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ namespace program_options = boost::program_options;
namespace chrono = std::chrono;

namespace Module {
const std::string Timer::Info::MODULE_NAME{"Timer"};
const std::string Timer::Info::COMMAND{"timer"};
const std::string Timer::Info::COMMAND_DESCRIPTION{"set timer"};
const std::string Timer::MODULE_NAME{"Timer"};
const std::string Timer::COMMAND{"timer"};
const std::string Timer::COMMAND_DESCRIPTION{"set timer"};

Timer::Timer() :
ModuleBase(Info::MODULE_NAME),
ModuleBase(MODULE_NAME),
SlashCommandProcessorBase()
{}


void Timer::InitializeAppCommand() {
SleepyDiscord::AppCommand::Option appCommand;
appCommand.name = Info::COMMAND;
appCommand.description = Info::COMMAND_DESCRIPTION;
appCommand.name = COMMAND;
appCommand.description = COMMAND_DESCRIPTION;

SleepyDiscord::AppCommand::Option duration;
duration.name = "duration";
Expand Down
8 changes: 3 additions & 5 deletions src/module/timer/timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ namespace Module {
class Timer : public ModuleBase , public SlashCommandProcessorBase{
private:
public:
struct Info {
const static std::string MODULE_NAME;
const static std::string COMMAND;
const static std::string COMMAND_DESCRIPTION;
};
const static std::string MODULE_NAME;
const static std::string COMMAND;
const static std::string COMMAND_DESCRIPTION;
Timer();
void InteractionHandler(SleepyDiscord::Interaction& interaction) override;
void InitializeAppCommand() override;
Expand Down
12 changes: 6 additions & 6 deletions src/module/urlshortening/URLShortening.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ namespace program_options = boost::program_options;

namespace Module {

const std::string URLShortening::Info::MODULE_NAME{"URLShortening"};
const std::string URLShortening::Info::COMMAND{"url"};
const std::string URLShortening::Info::DESCRIPTION{ "Shorten specific URLs" };
const std::string URLShortening::MODULE_NAME{"URLShortening"};
const std::string URLShortening::COMMAND{"url"};
const std::string URLShortening::DESCRIPTION{ "Shorten specific URLs" };

URLShortening::URLShortening() :
ModuleBase(Info::MODULE_NAME)
ModuleBase(MODULE_NAME)
{}

void URLShortening::InitializeAppCommand() {
SleepyDiscord::AppCommand::Option appCommand;
appCommand.name = Info::COMMAND;
appCommand.description = Info::DESCRIPTION;
appCommand.name = COMMAND;
appCommand.description = DESCRIPTION;

SleepyDiscord::AppCommand::Option url;
url.name = "url";
Expand Down
9 changes: 4 additions & 5 deletions src/module/urlshortening/URLShortening.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ namespace Module {
private:
std::string ShortenAmazonURL(const std::string& url);
public:
struct Info {
const static std::string MODULE_NAME;
const static std::string COMMAND;
const static std::string DESCRIPTION;
};
//constants
const static std::string MODULE_NAME;
const static std::string COMMAND;
const static std::string DESCRIPTION;
URLShortening();
void InteractionHandler(SleepyDiscord::Interaction& interaction) override;
void InitializeAppCommand() override;
Expand Down

0 comments on commit 7b85306

Please sign in to comment.