From ee3102ee40823f19ab772647f5a8d67c256d7660 Mon Sep 17 00:00:00 2001 From: rxdn <29165304+rxdn@users.noreply.github.com> Date: Fri, 8 Jan 2021 16:00:59 +0000 Subject: [PATCH] Fix Unknown Member for admins --- public/static/css/style.css | 11 ++++++++ public/templates/includes/head.tmpl | 4 +-- public/templates/layouts/main.tmpl | 14 ++++------ public/templates/views/index.tmpl | 40 ++++++++++++----------------- utils/permissionutils.go | 6 +++++ 5 files changed, 40 insertions(+), 35 deletions(-) diff --git a/public/static/css/style.css b/public/static/css/style.css index 6e14328..c61c35d 100644 --- a/public/static/css/style.css +++ b/public/static/css/style.css @@ -27,6 +27,11 @@ html > ::-webkit-scrollbar { } .sidebar { + display: inline-flex; + height: 100%; + width: 16.6%; + background-color: #4C566A; + float: left; background-size: cover; overflow-x: hidden !important; } @@ -220,6 +225,12 @@ html > ::-webkit-scrollbar { cursor: pointer; } +@media only screen and (max-width: 900px) { + .guild { + width: 100%; + } +} + .guild-icon { height: 80px; background-color: #272727; diff --git a/public/templates/includes/head.tmpl b/public/templates/includes/head.tmpl index f800003..c317ec3 100644 --- a/public/templates/includes/head.tmpl +++ b/public/templates/includes/head.tmpl @@ -37,9 +37,9 @@ integrity="sha256-4+XzXVhsDmqanXGHaHvgh1gMQKX40OUvDEBTu8JcmNs=" crossorigin="anonymous"> - - + --> diff --git a/public/templates/layouts/main.tmpl b/public/templates/layouts/main.tmpl index 1a24a9a..92e59cc 100644 --- a/public/templates/layouts/main.tmpl +++ b/public/templates/layouts/main.tmpl @@ -4,14 +4,10 @@ {{template "head" .}} -
- {{template "sidebar" .}} -
- {{template "loadingscreen" .}} - - {{template "notifymodal" .}} - {{template "content" .}} -
-
+ {{template "sidebar" .}} + diff --git a/public/templates/views/index.tmpl b/public/templates/views/index.tmpl index 8a5259b..d15c68e 100644 --- a/public/templates/views/index.tmpl +++ b/public/templates/views/index.tmpl @@ -1,30 +1,22 @@ {{define "content"}} -
-
-
-
-
-
-

Servers

-
-
-
-
-
- - Invite to your server -
-
- -
- -
-
-
+
+
+

Servers

+
+
+
+
+
+ + Invite to your server
+ +
+ +
diff --git a/utils/permissionutils.go b/utils/permissionutils.go index 6df7315..135bc66 100644 --- a/utils/permissionutils.go +++ b/utils/permissionutils.go @@ -10,6 +10,12 @@ func GetPermissionLevel(guildId, userId uint64) (permission.PermissionLevel, err if err != nil { return permission.Everyone, err } + + // do this check here before trying to get the member + if botContext.IsBotAdmin(userId) { + return permission.Admin, nil + } + // get member member, err := botContext.GetGuildMember(guildId, userId) if err != nil {