Correct null pointer close #25
This commit is contained in:
parent
5f5fc3ab16
commit
4bf0585fca
@ -26,7 +26,9 @@ public class DayTrigger implements Commande{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void action(String[] args, MessageReceivedEvent event) {
|
public void action(String[] args, MessageReceivedEvent event) {
|
||||||
|
if(!event.isFromType(ChannelType.PRIVATE))
|
||||||
event.getMessage().delete().queue();
|
event.getMessage().delete().queue();
|
||||||
|
DayListener.getInstance().trigger();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,7 +101,14 @@ public class MainBot {
|
|||||||
if (commandes.containsKey(cmd.commande))
|
if (commandes.containsKey(cmd.commande))
|
||||||
{
|
{
|
||||||
Commande cmdObj = commandes.get(cmd.commande);
|
Commande cmdObj = commandes.get(cmd.commande);
|
||||||
if(!cmdObj.isAdminCmd() || cmd.event.getMember().hasPermission(Permission.ADMINISTRATOR)){
|
boolean isAdmin;
|
||||||
|
if(cmd.event.isFromType(ChannelType.PRIVATE)){
|
||||||
|
isAdmin = jda.getGuilds().get(0).getMember(cmd.event.getAuthor()).hasPermission(Permission.ADMINISTRATOR);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
isAdmin = cmd.event.getMember().hasPermission(Permission.ADMINISTRATOR);
|
||||||
|
|
||||||
|
if(!cmdObj.isAdminCmd() || isAdmin){
|
||||||
|
|
||||||
if(cmd.event.isFromType(ChannelType.PRIVATE) && commandes.get(cmd.commande).isPrivateUsable())
|
if(cmd.event.isFromType(ChannelType.PRIVATE) && commandes.get(cmd.commande).isPrivateUsable())
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user