Skip to content

Commit 0aa9bbb

Browse files
committed
stuff
1 parent 8d18456 commit 0aa9bbb

13 files changed

Lines changed: 22 additions & 17 deletions

File tree

src/Cubic/Version.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ using namespace cubic::prelude;
66

77
asp::SystemTime const Version::s_uptime = asp::SystemTime::now();
88

9-
constexpr const char* Version::getPlatformDomain() const noexcept {
10-
switch (m_platform) {
9+
constexpr const char* Version::getPlatformDomain(GitPlatform plat) noexcept {
10+
switch (plat) {
1111
default: [[fallthrough]];
1212

1313
case GitPlatform::GitHub: return "github.com";
@@ -50,6 +50,10 @@ std::string Version::getVersionString(bool v, bool build) const {
5050
return fmt::format("v{}", base);
5151
};
5252

53+
std::string Version::getRepositoryURL() const {
54+
return fmt::format("https://{}/{}", getPlatformDomain(m_platform), m_repository);
55+
};
56+
5357
asp::Duration Version::getUptime() noexcept {
5458
return s_uptime.elapsed();
5559
};

src/Cubic/Version.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace cubic {
2525
std::string const m_repository = "CubicCommunity/CubicDiscord";
2626

2727
protected:
28-
constexpr const char* getPlatformDomain() const noexcept;
28+
static constexpr const char* getPlatformDomain(GitPlatform plat = GitPlatform::GitHub) noexcept;
2929

3030
public:
3131
static asp::Duration getUptime() noexcept;
@@ -38,6 +38,7 @@ namespace cubic {
3838
std::string_view getBuildTag() const noexcept;
3939
uint8_t getBuildNumber() const noexcept;
4040

41+
std::string getRepositoryURL() const;
4142
std::string getVersionString(bool v = true, bool build = true) const;
4243
};
4344
};

src/Cubic/cluster/src/CommandManager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ void CommandManager::registerAll(dpp::cluster& bot, dpp::snowflake server) {
1313
for (auto const& cmd : cmds) {
1414
auto name = cmd->name();
1515

16-
log::debug("Integrating '{}'...", name);
16+
log::trace("Integrating '{}'...", name);
1717
m_commands[std::move(name)] = cmd;
1818
};
1919

@@ -37,7 +37,7 @@ void CommandManager::registerAll(dpp::cluster& bot, dpp::snowflake server) {
3737

3838
dpp::task<void> CommandManager::handleCommand(dpp::slashcommand_t const& event) {
3939
auto const name = event.command.get_command_name();
40-
log::debug("Received command event for '{}'", name);
40+
log::trace("Received command event for '{}'", name);
4141

4242
if (event.command.type == dpp::interaction_type::it_application_command) {
4343
log::trace("Looking through {} entries to find '{}'...", m_commands.size(), name);

src/Cubic/util/Macros.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
#define CUBIC_AVATAR_FORMAT dpp::i_gif
77
#endif
88

9-
#define CUBIC_INIT_COMMAND(T) \
10-
static T cmd
9+
#define CUBIC_INIT(T) \
10+
static T t
1111

1212
#define CUBIC_CMD_FUNC_NAME_SIGN std::string name() const noexcept
1313
#define CUBIC_CMD_FUNC_BUILD_SIGN dpp::slashcommand build() const

src/cmds/fun/8Ball.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,4 @@ class EightBallCommand final : public base::Command {
7575
constexpr bool needsThinking() const noexcept override { return true; };
7676
};
7777

78-
CUBIC_INIT_COMMAND(EightBallCommand);
78+
CUBIC_INIT(EightBallCommand);

src/cmds/util/About.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ class AboutCommand final : public base::Command {
4848
};
4949
};
5050

51-
CUBIC_INIT_COMMAND(AboutCommand);
51+
CUBIC_INIT(AboutCommand);

src/cmds/util/Ping.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class PingCommand final : public base::Command {
3838
auto const end = asp::Instant::now();
3939
auto dur = end.durationSince(start).millis();
4040

41-
log::debug("Ping command latency: {}ms", dur);
41+
log::trace("Ping command latency: {}ms", dur);
4242

4343
co_await ev.co_edit_original_response(
4444
dpp::message()
@@ -53,4 +53,4 @@ class PingCommand final : public base::Command {
5353
};
5454
};
5555

56-
CUBIC_INIT_COMMAND(PingCommand);
56+
CUBIC_INIT(PingCommand);

src/cmds/util/Say.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,4 +133,4 @@ class SayCommand final : public base::Command {
133133
};
134134
};
135135

136-
CUBIC_INIT_COMMAND(SayCommand);
136+
CUBIC_INIT(SayCommand);

src/cmds/util/WelcomeTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ class WelcomeTestCommand final : public base::Command {
4848
};
4949
};
5050

51-
CUBIC_INIT_COMMAND(WelcomeTestCommand);
51+
CUBIC_INIT(WelcomeTestCommand);

src/events/Crosspost.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ class CrosspostEvent final : public base::EventHandler {
6363
};
6464
};
6565

66-
static CrosspostEvent ev;
66+
CUBIC_INIT(CrosspostEvent);

0 commit comments

Comments
 (0)