Merge branch 'master' into devel
This commit is contained in:
commit
eacba43ce0
36
src/main/java/net/Broken/Commands/GetChannels.java
Normal file
36
src/main/java/net/Broken/Commands/GetChannels.java
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
package net.Broken.Commands;
|
||||||
|
|
||||||
|
import net.Broken.Commande;
|
||||||
|
import net.Broken.Tools.EmbedMessageUtils;
|
||||||
|
import net.dv8tion.jda.core.EmbedBuilder;
|
||||||
|
import net.dv8tion.jda.core.entities.TextChannel;
|
||||||
|
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
|
||||||
|
public class GetChannels implements Commande{
|
||||||
|
@Override
|
||||||
|
public void action(String[] args, MessageReceivedEvent event) {
|
||||||
|
event.getGuild().getTextChannels();
|
||||||
|
EmbedBuilder eb = new EmbedBuilder().setColor(Color.green);
|
||||||
|
for(TextChannel channel : event.getGuild().getTextChannels())
|
||||||
|
eb.addField(channel.getName(),"ID: " + channel.getId(), false);
|
||||||
|
|
||||||
|
event.getTextChannel().sendMessage(EmbedMessageUtils.buildStandar(eb)).complete();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isPrivateUsable() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAdminCmd() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isNSFW() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
@ -108,6 +108,7 @@ public class Preference implements Commande {
|
|||||||
GuildPreferenceEntity pref = getPreference(event.getGuild());
|
GuildPreferenceEntity pref = getPreference(event.getGuild());
|
||||||
switch (key){
|
switch (key){
|
||||||
case "anti_spam":
|
case "anti_spam":
|
||||||
|
value = value.replaceAll(" ", "");
|
||||||
if(value.toLowerCase().equals("true") || value.toLowerCase().equals("false")){
|
if(value.toLowerCase().equals("true") || value.toLowerCase().equals("false")){
|
||||||
boolean result = Boolean.parseBoolean(value);
|
boolean result = Boolean.parseBoolean(value);
|
||||||
pref.setAntiSpam(result);
|
pref.setAntiSpam(result);
|
||||||
@ -125,6 +126,7 @@ public class Preference implements Commande {
|
|||||||
|
|
||||||
|
|
||||||
case "default_role":
|
case "default_role":
|
||||||
|
value = value.replaceAll(" ", "");
|
||||||
if(value.toLowerCase().equals("true") || value.toLowerCase().equals("false")){
|
if(value.toLowerCase().equals("true") || value.toLowerCase().equals("false")){
|
||||||
boolean result = Boolean.parseBoolean(value);
|
boolean result = Boolean.parseBoolean(value);
|
||||||
pref.setDefaultRole(result);
|
pref.setDefaultRole(result);
|
||||||
@ -140,6 +142,7 @@ public class Preference implements Commande {
|
|||||||
break;
|
break;
|
||||||
case "default_role_id":
|
case "default_role_id":
|
||||||
try{
|
try{
|
||||||
|
value = value.replaceAll(" ", "");
|
||||||
Role role = event.getGuild().getRoleById(value);
|
Role role = event.getGuild().getRoleById(value);
|
||||||
if(role != null){
|
if(role != null){
|
||||||
pref.setDefaultRoleId(role.getId());
|
pref.setDefaultRoleId(role.getId());
|
||||||
@ -162,6 +165,7 @@ public class Preference implements Commande {
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
case "welcome":
|
case "welcome":
|
||||||
|
value = value.replaceAll(" ", "");
|
||||||
if(value.toLowerCase().equals("true") || value.toLowerCase().equals("false")){
|
if(value.toLowerCase().equals("true") || value.toLowerCase().equals("false")){
|
||||||
boolean result = Boolean.parseBoolean(value);
|
boolean result = Boolean.parseBoolean(value);
|
||||||
pref.setWelcome(result);
|
pref.setWelcome(result);
|
||||||
@ -177,6 +181,7 @@ public class Preference implements Commande {
|
|||||||
break;
|
break;
|
||||||
case "welcome_chanel_id":
|
case "welcome_chanel_id":
|
||||||
try{
|
try{
|
||||||
|
value = value.replaceAll(" ", "");
|
||||||
TextChannel chanel = event.getGuild().getTextChannelById(value);
|
TextChannel chanel = event.getGuild().getTextChannelById(value);
|
||||||
if(chanel != null){
|
if(chanel != null){
|
||||||
pref.setWelcomeChanelID(chanel.getId());
|
pref.setWelcomeChanelID(chanel.getId());
|
||||||
@ -192,7 +197,7 @@ public class Preference implements Commande {
|
|||||||
throw new NumberFormatException();
|
throw new NumberFormatException();
|
||||||
}
|
}
|
||||||
}catch (NumberFormatException e){
|
}catch (NumberFormatException e){
|
||||||
MessageEmbed msg = EmbedMessageUtils.buildStandar(EmbedMessageUtils.getError("\nRole not found!\n\nUse `//listroles` to get roles id"));
|
MessageEmbed msg = EmbedMessageUtils.buildStandar(EmbedMessageUtils.getError("\nText channel not found!\n\nUse `//listroles` to get roles id"));
|
||||||
Message sended = event.getTextChannel().sendMessage(msg).complete();
|
Message sended = event.getTextChannel().sendMessage(msg).complete();
|
||||||
new MessageTimeOut(MainBot.messageTimeOut, sended, event.getMessage()).start();
|
new MessageTimeOut(MainBot.messageTimeOut, sended, event.getMessage()).start();
|
||||||
}
|
}
|
||||||
|
@ -10,34 +10,39 @@
|
|||||||
|
|
||||||
<!-- CSS -->
|
<!-- CSS -->
|
||||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"/>
|
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"/>
|
||||||
<link href="css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection"/>
|
<link href="/css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection"/>
|
||||||
<link href="css/style.css" type="text/css" rel="stylesheet" media="screen,projection"/>
|
<link href="/css/style.css" type="text/css" rel="stylesheet" media="screen,projection"/>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="blue-grey lighten-5" >
|
<body class="blue-grey lighten-5" >
|
||||||
|
|
||||||
<nav class="blue-grey darken-4 z-depth-3" role="navigation" >
|
<nav class="blue-grey darken-4 z-depth-3" role="navigation" >
|
||||||
<div class="nav-wrapper container">
|
<div class="nav-wrapper container">
|
||||||
<a id="logo-container" href="/" class="brand-logo">Discord Bot</a>
|
<a id="logo-container" href="/" class="brand-logo">Claptrap Bot</a>
|
||||||
<ul class="right hide-on-med-and-down">
|
<ul class="right hide-on-med-and-down">
|
||||||
|
|
||||||
<li class="">
|
<li class="" th:classappend="(${page} == 'home')? 'active' : ''">
|
||||||
<a class="waves-effect waves-light sidenav-trigger" href="/" data-target="slide-out">Home</a>
|
<a class="waves-effect waves-light" href="/">Home</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="" >
|
<li class="" th:classappend="(${page} == 'music')? 'active' : ''">
|
||||||
<a class="waves-effect waves-light" href="/music">Music Control</a>
|
<a class="waves-effect waves-light" href="/music">Music Control</a>
|
||||||
</li>
|
</li>
|
||||||
<li id="nav-bar-account">
|
<li id="nav-bar-account">
|
||||||
<a class="dropdown-account" data-activates="dropdown1"><i class="material-icons">account_box</i></a>
|
<a class="dropdown-account dropdown-trigger" data-target="dropdown_connected"><i class="material-icons">account_box</i></a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<ul id="nav-mobile" class="side-nav">
|
|
||||||
<li class="center">
|
<a href="#" data-target="nav-mobile" class="sidenav-trigger"><i class="material-icons">menu</i></a>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<ul id="nav-mobile" class="sidenav">
|
||||||
|
<li class="center" th:classappend="(${page} == 'home')? 'active' : ''">
|
||||||
<a class="waves-effect waves-light sidenav-trigger" href="/" data-target="slide-out">Home</a>
|
<a class="waves-effect waves-light sidenav-trigger" href="/" data-target="slide-out">Home</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="center">
|
<li class="center" th:classappend="(${page} == 'music')? 'active' : ''">
|
||||||
<a class="waves-effect waves-light" href="/music">Music Control</a>
|
<a class="waves-effect waves-light" href="/music">Music Control</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
@ -53,10 +58,12 @@
|
|||||||
|
|
||||||
<li><a class="center red-text nav-disconnect" style="font-weight: bold">Disconnect</a></li>
|
<li><a class="center red-text nav-disconnect" style="font-weight: bold">Disconnect</a></li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
<a href="#" data-activates="nav-mobile" class="button-navbar-mobile button-collapse"><i class="material-icons">menu</i></a>
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Dropdown connected -->
|
<!-- Dropdown connected -->
|
||||||
<ul id="dropdown_connected" class="dropdown-content ">
|
<ul id="dropdown_connected" class="dropdown-content ">
|
||||||
@ -93,14 +100,16 @@
|
|||||||
<div class="input-field col s6 offset-s3">
|
<div class="input-field col s6 offset-s3">
|
||||||
<i class="material-icons prefix">account_box</i>
|
<i class="material-icons prefix">account_box</i>
|
||||||
<input name="username" id="user_input" type="text" class="validate"/>
|
<input name="username" id="user_input" type="text" class="validate"/>
|
||||||
<label for="user_input" data-error="User not registered!">User Name</label>
|
<label for="user_input" >User Name</label>
|
||||||
|
<span class="helper-text" data-error="User not registered!"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="input-field col s6 offset-s3">
|
<div class="input-field col s6 offset-s3">
|
||||||
<i class="material-icons prefix">security</i>
|
<i class="material-icons prefix">security</i>
|
||||||
<input name="password" id="password_input" type="password" class="validate"/>
|
<input name="password" id="password_input" type="password" class="validate"/>
|
||||||
<label for="password_input" data-error="Wrong password!">Password</label>
|
<label for="password_input">Password</label>
|
||||||
|
<span class="helper-text" data-error="Wrong password!"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row" style="margin-bottom: 10px">
|
<div class="row" style="margin-bottom: 10px">
|
||||||
@ -120,6 +129,34 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!--________________________________________-->
|
||||||
|
<!-- Guild modal -->
|
||||||
|
<!--________________________________________-->
|
||||||
|
|
||||||
|
<div id="modal_guild" class="modal">
|
||||||
|
<div class="modal-content" style="padding-bottom: 0px">
|
||||||
|
<div class="row" style="margin-bottom: 0px">
|
||||||
|
<h3 class="col s12 center">Guild Selection</h3>
|
||||||
|
<div class="col offset-s4 s4 center">
|
||||||
|
<form id="guild_form" action="#" class="left-align">
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<a href="#" id="btn_ok_guild" class="modal-action modal-close waves-effect waves-green btn-flat disabled">Ok</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p id="radioTemplateGuild" class="" style="visibility: hidden; display: none ">
|
||||||
|
<label>
|
||||||
|
<input name="guildRadio" class="with-gap" type="radio" value="@id" id="@id"/>
|
||||||
|
<span>@name</span>
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
|
|
||||||
<!--__________________________________________________________-->
|
<!--__________________________________________________________-->
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<!-- END -->
|
<!-- END -->
|
||||||
|
@ -174,7 +174,7 @@ function getGuild(){
|
|||||||
$('#guild_form').empty();
|
$('#guild_form').empty();
|
||||||
|
|
||||||
if(data.length === 1){
|
if(data.length === 1){
|
||||||
Cookies.set('guild', data.id, { expires: 31 });
|
Cookies.set('guild', data[0].id, { expires: 31 });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
data.forEach(function(element){
|
data.forEach(function(element){
|
||||||
|
@ -23,15 +23,7 @@
|
|||||||
<!--__________________________________________________________-->
|
<!--__________________________________________________________-->
|
||||||
<nav class="blue-grey darken-4 z-depth-3" role="navigation">
|
<nav class="blue-grey darken-4 z-depth-3" role="navigation">
|
||||||
<div class="nav-wrapper container">
|
<div class="nav-wrapper container">
|
||||||
<a id="logo-container" href="/" class="brand-logo">Discord Bot</a>
|
<a id="logo-container" href="/" class="brand-logo">Claptrap Bot</a>
|
||||||
<ul class="right hide-on-med-and-down">
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<ul id="nav-mobile" class="side-nav">
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
<a href="#" data-activates="nav-mobile" class="button-navbar-mobile button-collapse"><i class="material-icons">menu</i></a>
|
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user