Correct admin and add coming soon to main page

This commit is contained in:
Sebastien 2018-04-29 17:18:42 +02:00
parent 38eb8c39f7
commit 2fa196e61a
3 changed files with 20 additions and 4 deletions

View File

@ -9,6 +9,7 @@ import net.Broken.Tools.TableRenderer;
import net.dv8tion.jda.core.EmbedBuilder; import net.dv8tion.jda.core.EmbedBuilder;
import net.dv8tion.jda.core.Permission; import net.dv8tion.jda.core.Permission;
import net.dv8tion.jda.core.entities.ChannelType; import net.dv8tion.jda.core.entities.ChannelType;
import net.dv8tion.jda.core.entities.Guild;
import net.dv8tion.jda.core.entities.Message; import net.dv8tion.jda.core.entities.Message;
import net.dv8tion.jda.core.entities.MessageEmbed; import net.dv8tion.jda.core.entities.MessageEmbed;
import net.dv8tion.jda.core.events.message.MessageReceivedEvent; import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
@ -119,8 +120,18 @@ public class Help implements Commande {
List<String> noPu = new ArrayList<>(); List<String> noPu = new ArrayList<>();
boolean isAdmin; boolean isAdmin;
if(event.isFromType(ChannelType.PRIVATE)) if(event.isFromType(ChannelType.PRIVATE)){
isAdmin = event.getGuild().getMember(event.getAuthor()).hasPermission(Permission.ADMINISTRATOR); isAdmin = false;
List<Guild> guilds = event.getAuthor().getMutualGuilds();
for(Guild iterator : guilds){
if(iterator.getMember(event.getAuthor()).hasPermission(Permission.ADMINISTRATOR)){
isAdmin = true;
break;
}
}
}
else else
isAdmin = event.getMember().hasPermission(Permission.ADMINISTRATOR); isAdmin = event.getMember().hasPermission(Permission.ADMINISTRATOR);

View File

@ -1,5 +1,7 @@
``` ```
@list @list
``` ```
_PU = Private Usable (Utilisable en Message Privée)_ _PU = Private Usable (Utilisable en Message Privée)_
**>** __**[Web UI](https://bot.seb6596.ovh )**__ :arrow_right: Music control, General server info (Coming soon)

View File

@ -19,7 +19,10 @@
<div th:replace="header :: header ('home')">...</div> <div th:replace="header :: header ('home')">...</div>
<div class="section no-pad-bot main" id="index-banner"> <div class="section no-pad-bot main" id="index-banner">
<div class="center center-align">
<h2>Home Page</h2>
<h1>Coming Soon</h1>
</div>
</div> </div>
<script> <script>