Skip to content
This repository was archived by the owner on Dec 1, 2021. It is now read-only.

Commit 6ac47e7

Browse files
committed
Remove perm_strs
1 parent e033f7b commit 6ac47e7

2 files changed

Lines changed: 0 additions & 54 deletions

File tree

include/aegis/impl/permission.cpp

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -30,36 +30,4 @@ AEGIS_DECL void to_json(nlohmann::json& j, const permission& s)
3030
}
3131
/// \endcond
3232

33-
AEGIS_DECL const std::unordered_map<int64_t, const std::string> permission::perm_strs {
34-
{0x1, "Create invites"},
35-
{0x2, "Kick members"},
36-
{0x4, "Ban members"},
37-
{0x8, "Administrator"},
38-
{0x10, "Manage channels"},
39-
{0x20, "Manage server"},
40-
{0x40, "Add reactions"},
41-
{0x80, "View audit log"},
42-
{0x400, "Read messages"},
43-
{0x800, "Send messages"},
44-
{0x1000, "Use TTS"},
45-
{0x2000, "Manage messages"},
46-
{0x4000, "Send embeds"},
47-
{0x8000, "Attach files"},
48-
{0x10000, "Read message history"},
49-
{0x20000, "Mention everyone"},
50-
{0x40000, "Use external emoji"},
51-
{0x4000000, "Change nickname"},
52-
{0x8000000, "Manage nicknames"},
53-
{0x10000000, "Manage roles"},
54-
{0x20000000, "Manage webhooks"},
55-
{0x40000000, "Manage emojis"},
56-
{0x100000, "Connect to VC"},
57-
{0x400000, "Server mute"},
58-
{0x200000, "Speak in VC"},
59-
{0x800000, "Server deafen"},
60-
{0x1000000, "Move VC members"},
61-
{0x2000000, "Use voice activity"},
62-
{0x100, "Priority speaker"}
63-
};
64-
6533
}

include/aegis/permission.hpp

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -67,27 +67,6 @@ class permission
6767
return _allow_permissions;
6868
}
6969

70-
/// Gets the names of allowed permissions
71-
/**
72-
* @returns string vector of allowed permissions' names
73-
*/
74-
std::vector<std::string> perms_to_strs() {
75-
std::vector<std::string> out;
76-
for (auto& pair : perm_strs) {
77-
if ((_allow_permissions & pair.first) > 0) out.push_back(pair.second);
78-
}
79-
return out;
80-
}
81-
82-
/// Gets the name of a permission
83-
/**
84-
* @param perm bitmap value of perm
85-
* @returns name of permission
86-
*/
87-
static const std::string& perm_str(int64_t perm) {
88-
return perm_strs.at(perm);
89-
}
90-
9170
int64_t get_allow_perms() const noexcept { return _allow_permissions; }
9271
bool can_invite() const noexcept { return (_allow_permissions & 0x1) > 0; }
9372
bool can_kick() const noexcept { return (_allow_permissions & 0x2) > 0; }
@@ -152,7 +131,6 @@ class permission
152131

153132
private:
154133
int64_t _allow_permissions = 0;
155-
AEGIS_DECL static const std::unordered_map<int64_t, const std::string> perm_strs;
156134
};
157135

158136
/// \cond TEMPLATES

0 commit comments

Comments
 (0)