Skip to content

Commit

Permalink
[0.1.3.0]: Meta update
Browse files Browse the repository at this point in the history
- All bugs are gone!
  • Loading branch information
harshfeudal committed Oct 26, 2022
1 parent cfccb76 commit c68d3dc
Show file tree
Hide file tree
Showing 13 changed files with 70 additions and 51 deletions.
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ These are libraries that we're using in this project:
- [Spdlog](https://github.com/gabime/spdlog) - version `1.10.0` (latest)

Bot current version:
- BETA version - `0.1.2.386` (`Release`)
- BETA version - `0.1.3.0` (`Release`)
- Stable version - `Unknown`

### 🚨 Generate and use
Expand Down Expand Up @@ -57,10 +57,6 @@ Bot current version:
- Visual Studio platform `x64`
- C++ 17 `ISO/IEC 14882`
- Please install `.dll` files on [dpp page](https://dpp.dev/) and put it near your `.exe` executable file so that it will run well
- Issue may occur: [LNK2005](https://learn.microsoft.com/en-us/cpp/error-messages/tool-errors/linker-tools-error-lnk2005?f1url=%3FappId%3DDev16IDEF1%26l%3DEN-US%26k%3Dk(LNK2005)%26rd%3Dtrue&view=msvc-170) from Visual Studio. To fix that, please follow these steps:
1. Open the project's **Property Pages** dialog box. For more information, see [Set compiler and build properties](https://learn.microsoft.com/en-us/cpp/build/working-with-project-properties?view=msvc-170).
2. Select the **Configuration Properties > Linker > General property page**.
3. Modify the **Force File Output** property and choose **/FORCE:MULTIPLE**. Choose **OK** or **Apply** to save your changes.

Other cases may not compile or crash occurs.

Expand Down
8 changes: 4 additions & 4 deletions Raiden Shogun.rc
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#include <Winver.h>

#define FILEVERSION_STR "0.1.2.386"
#define PRODUCTVERSION_STR "0.1.2.386"
#define FILEVERSION_STR "0.1.3.0"
#define PRODUCTVERSION_STR "0.1.3.0"

VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,1,2,386
PRODUCTVERSION 0,1,2,386
FILEVERSION 0,1,3,0
PRODUCTVERSION 0,1,3,0
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
Expand Down
5 changes: 5 additions & 0 deletions commands/feedback.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#pragma once

#include <dpp/dpp.h>

void feedback(dpp::cluster& client, const dpp::slashcommand_t& event);
6 changes: 3 additions & 3 deletions handler/btnHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ struct Session
}
};

std::unordered_map<uint64_t, Session> cachedSessions;
std::shared_mutex cachedSessionsMutex;
uint64_t customIdCounter;
inline std::unordered_map<uint64_t, Session> cachedSessions;
inline std::shared_mutex cachedSessionsMutex;
inline uint64_t customIdCounter;

inline void ButtonClear()
{
Expand Down
4 changes: 2 additions & 2 deletions handler/builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

void SlashCommandCreate(dpp::cluster& client);

std::map<std::string, commandDef> commands
inline std::map<std::string, commandDef> commands
{
{
"ping", { "Check Raiden Shogun latecy", ping }
Expand Down Expand Up @@ -71,7 +71,7 @@ std::map<std::string, commandDef> commands
}
};

void SlashCommandCreate(dpp::cluster& client)
inline void SlashCommandCreate(dpp::cluster& client)
{
if (dpp::run_once<struct register_commands>())
{
Expand Down
17 changes: 17 additions & 0 deletions include/genshin/routes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#pragma once

/*
* This is Genshin Impact C++ library, written by Harshfeudal
* Coming soon!
*
*/

#define WEBSTATIC_URL "https://webstatic-sea.hoyoverse.com/"

#define COMMUNITY_URL_OVERSEAS "https://bbs-api-os.hoyolab.com/community/apihub/"
#define COMMUNITY_URL_CHINESE "https://api-takumi-record.mihoyo.com/community/apihub/"

#define RECORD_URL_OVERSEAS "https://bbs-api-os.hoyolab.com/game_record/"
#define RECORD_URL_CHINESE "https://api-takumi-record.mihoyo.com/game_record/app/"

// Working in progress ...
2 changes: 0 additions & 2 deletions include/harshfeudal/shorten.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#pragma once

#include <dpp/dpp.h>
#include <spdlog/spdlog.h>
#include <string>

#define NO_MSG_TYPE dpp::mt_default
Expand Down
32 changes: 6 additions & 26 deletions premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,14 @@ project "Raiden Shogun"
targetdir ("%{wks.location}/x64/%{cfg.buildcfg}")
objdir ("%{wks.location}/x64/%{cfg.buildcfg}")

includedirs
{
"include"
}

libdirs
{
"lib"
}

links
{
"dpp.lib"
}

files
{
"src/**.cpp",
"commands/**.h"
}
includedirs{ "include" }
libdirs { "lib" }
links { "dpp.lib" }
files { "src/**.cpp", "commands/**.h" }

filter "system:windows"
filter { "system:windows", "toolset:msc" }
systemversion "latest"

filter "configurations:Release"
runtime "Release"
optimize "on"

filter("toolset:msc")
linkoptions("/FORCE:MULTIPLE")

optimize "on"
20 changes: 15 additions & 5 deletions src/ban.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
#include <spdlog/spdlog.h>
#include <harshfeudal/shorten.h>

#include "../handler/handler.h"
#include "../handler/btnHandler.h"
#include "../commands/ban.h"

void ban(dpp::cluster& client, const dpp::slashcommand_t& event)
{
auto usr = std::get<dpp::snowflake>(event.get_parameter("member"));
auto usr = std::get<dpp::snowflake>(event.get_parameter("member"));
auto tgtReason = event.get_parameter("reason");

auto source = event.command.usr.id;
auto gFind = dpp::find_guild(event.command.guild_id);
auto tgtGuild = event.command.guild_id;
auto source = event.command.usr.id;
auto gFind = dpp::find_guild(event.command.guild_id);
auto tgtGuild = event.command.guild_id;
auto tgtChannel = event.command.channel_id;

const auto tgtUser = gFind->members.find(usr);
Expand Down Expand Up @@ -43,6 +42,17 @@ void ban(dpp::cluster& client, const dpp::slashcommand_t& event)

return;
}

/*
if (!dpp::permission().has(dpp::p_ban_members))
{
harshfeudal::SlashMessageReply(
event, "I have lack of permission to ban", dpp::m_ephemeral, NO_MSG_TYPE
);
return;
}
*/

auto b_Component = dpp::component().set_label("Ban")
.set_type(dpp::cot_button)
Expand Down
6 changes: 6 additions & 0 deletions src/feedback.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include "../commands/feedback.h"

void feedback(dpp::cluster& client, const dpp::slashcommand_t& event)
{
// Working in progress ...
}
12 changes: 11 additions & 1 deletion src/kick.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include <spdlog/spdlog.h>
#include <set>

#include "../handler/handler.h"
#include "../handler/btnHandler.h"
Expand Down Expand Up @@ -43,6 +42,17 @@ void kick(dpp::cluster& client, const dpp::slashcommand_t& event)

return;
}

/*
if (!dpp::permission().has(dpp::p_kick_members))
{
harshfeudal::SlashMessageReply(
event, "I have lack of permission to kick", dpp::m_ephemeral, NO_MSG_TYPE
);
return;
}
*/

auto k_Component = dpp::component().set_label("Kick")
.set_type(dpp::cot_button)
Expand Down
1 change: 0 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include <fstream>
#include <chrono>
#include <map>

#include <spdlog/spdlog.h>
Expand Down
2 changes: 0 additions & 2 deletions src/userInfo.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#pragma once

#include "../commands/userInfo.h"

void userInfo(dpp::cluster& client, const dpp::slashcommand_t& event)
Expand Down

0 comments on commit c68d3dc

Please sign in to comment.