Skip to content

Commit

Permalink
Merge pull request jagrosh#1479 from MichailiK/fix/eval-shenanigans
Browse files Browse the repository at this point in the history
Fix eval command failing in DMs
  • Loading branch information
jagrosh authored Feb 10, 2024
2 parents 2c76164 + 53875f2 commit e595de2
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.jagrosh.jdautilities.command.CommandEvent;
import com.jagrosh.jmusicbot.Bot;
import com.jagrosh.jmusicbot.commands.OwnerCommand;
import net.dv8tion.jda.api.entities.ChannelType;

/**
*
Expand All @@ -45,8 +46,10 @@ protected void execute(CommandEvent event)
se.put("bot", bot);
se.put("event", event);
se.put("jda", event.getJDA());
se.put("guild", event.getGuild());
se.put("channel", event.getChannel());
if (event.getChannelType() != ChannelType.PRIVATE) {
se.put("guild", event.getGuild());
se.put("channel", event.getChannel());
}
try
{
event.reply(event.getClient().getSuccess()+" Evaluated Successfully:\n```\n"+se.eval(event.getArgs())+" ```");
Expand Down

0 comments on commit e595de2

Please sign in to comment.