Remove space from value for id on pref

This commit is contained in:
Sebastien 2018-05-03 10:31:21 +02:00
parent 61c0d31dbc
commit 91f35592f4

View File

@ -140,6 +140,7 @@ public class Preference implements Commande {
break;
case "default_role_id":
try{
value = value.replaceAll(" ", "");
Role role = event.getGuild().getRoleById(value);
if(role != null){
pref.setDefaultRoleId(role.getId());
@ -177,6 +178,7 @@ public class Preference implements Commande {
break;
case "welcome_chanel_id":
try{
value = value.replaceAll(" ", "");
TextChannel chanel = event.getGuild().getTextChannelById(value);
if(chanel != null){
pref.setWelcomeChanelID(chanel.getId());