Skip to content

Commit 53875f2

Browse files
committed
Properly fix eval command failing in DMs
1 parent cd7e643 commit 53875f2

File tree

1 file changed

+5
-0
lines changed
  • src/main/java/com/jagrosh/jmusicbot/commands/owner

1 file changed

+5
-0
lines changed

src/main/java/com/jagrosh/jmusicbot/commands/owner/EvalCmd.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import com.jagrosh.jdautilities.command.CommandEvent;
2121
import com.jagrosh.jmusicbot.Bot;
2222
import com.jagrosh.jmusicbot.commands.OwnerCommand;
23+
import net.dv8tion.jda.api.entities.ChannelType;
2324

2425
/**
2526
*
@@ -45,6 +46,10 @@ protected void execute(CommandEvent event)
4546
se.put("bot", bot);
4647
se.put("event", event);
4748
se.put("jda", event.getJDA());
49+
if (event.getChannelType() != ChannelType.PRIVATE) {
50+
se.put("guild", event.getGuild());
51+
se.put("channel", event.getChannel());
52+
}
4853
try
4954
{
5055
event.reply(event.getClient().getSuccess()+" Evaluated Successfully:\n```\n"+se.eval(event.getArgs())+" ```");

0 commit comments

Comments
 (0)