use of net.dv8tion.jda.core.entities.Message in project MOOTBoot by LeshDev.
the class serverInfo method onMessageReceived.
public void onMessageReceived(MessageReceivedEvent e) {
Message msg = e.getMessage();
EmbedBuilder eB = new EmbedBuilder();
if (!msg.getRawContent().startsWith("-server") || bannedList.black.contains(e.getAuthor().getIdLong()) || e.getAuthor().isBot()) {
return;
}
eB.setAuthor("Server Infos", null, lib.bot_image);
eB.addField("**Owner**", "" + e.getGuild().getOwner().getEffectiveName(), true);
eB.addField("**Name**", "" + e.getGuild().getName(), true);
eB.addField("**Region**", e.getGuild().getRegion().getName(), true);
eB.setThumbnail(e.getGuild().getIconUrl());
eB.setColor(java.awt.Color.RED);
e.getChannel().sendMessage(eB.build()).queue();
}
use of net.dv8tion.jda.core.entities.Message in project MOOTBoot by LeshDev.
the class pingPongGame method onMessageReceived.
public void onMessageReceived(MessageReceivedEvent e) {
Message msg = e.getMessage();
if (!msg.getRawContent().startsWith("-pingGame") || bannedList.black.contains(e.getAuthor().getIdLong())) {
return;
}
if (!e.equals(e.getJDA().getSelfUser())) {
return;
}
e.getChannel().sendMessage("Pong").queue();
if (!msg.getRawContent().startsWith("ping") || bannedList.black.contains(e.getAuthor().getIdLong()) || !e.equals(e.getJDA().getSelfUser())) {
e.getChannel().sendMessage("F*ck YEAH !!! Bot wins").queue();
}
e.getChannel().sendMessage("Ping").queue();
if (!msg.getRawContent().startsWith("ping") || bannedList.black.contains(e.getAuthor().getIdLong()) || !e.equals(e.getJDA().getSelfUser())) {
e.getChannel().sendMessage("F*ck YEAH !!! Bot wins").queue();
}
e.getChannel().sendMessage("Pong").queue();
if (!msg.getRawContent().startsWith("pong") || bannedList.black.contains(e.getAuthor().getIdLong()) || !e.equals(e.getJDA().getSelfUser())) {
e.getChannel().sendMessage("F*ck YEAH !!! Bot wins").queue();
}
e.getChannel().sendMessage(e.getAuthor().getAsMention() + " has won :(").queue();
}
use of net.dv8tion.jda.core.entities.Message in project MOOTBoot by LeshDev.
the class botHelp method onMessageReceived.
public void onMessageReceived(MessageReceivedEvent e) {
Message msg = e.getMessage();
if (!msg.getRawContent().startsWith("-help") || bannedList.black.contains(e.getAuthor().getIdLong()) || e.getAuthor().isBot()) {
return;
}
EmbedBuilder eB = new EmbedBuilder();
eB.setAuthor("Help Menu for " + lib.bot_name, null, lib.bot_image);
eB.addField("**Bot Info**", "-info > Gives infos about the bot", true);
eB.addField("**User Info**", "-user <@User> > Gives infos about the user", true);
eB.addField("**Change Game**", "-game <String> > Change the 'Playing' status", true);
eB.addField("**Server Info**", "-server > Gives infos about the server", true);
eB.addField("**Ideen**", "-ideen / -ideen add > Shows Ideas list / Add new ideas", true);
eB.addField("**Ping**", "-ping > Shows ping from user and bot", true);
eB.addField("**Clock**", "-clock > Shows current time", true);
eB.setColor(java.awt.Color.YELLOW);
e.getChannel().sendMessage(eB.build()).queue();
}
use of net.dv8tion.jda.core.entities.Message in project MOOTBoot by LeshDev.
the class clock method onMessageReceived.
public void onMessageReceived(MessageReceivedEvent e) {
Message msg = e.getMessage();
if (!msg.getRawContent().toLowerCase().startsWith("-clock") || bannedList.black.contains(e.getAuthor().getIdLong()) || e.getAuthor().isBot() || !permittedList.perm.contains(e.getAuthor().getIdLong())) {
return;
}
EmbedBuilder eB = new EmbedBuilder();
eB.setTitle("Time");
eB.setColor(lib.randomColor());
eB.setDescription(currentTime());
e.getChannel().sendMessage(eB.build()).queue(sentMsg -> {
if (msg.getRawContent().contains("temp")) {
sentMsg.delete().queueAfter(5, SECONDS);
msg.delete().queue();
}
});
}
use of net.dv8tion.jda.core.entities.Message in project MantaroBot by Mantaro.
the class ActionCmds method meow.
@Command
public static void meow(CommandRegistry registry) {
registry.register("meow", new SimpleCommand(Category.ACTION) {
@Override
protected void call(GuildMessageReceivedEvent event, String content, String[] args) {
Message receivedMessage = event.getMessage();
if (!receivedMessage.getMentionedUsers().isEmpty()) {
String mew = event.getMessage().getMentionedUsers().stream().map(IMentionable::getAsMention).collect(Collectors.joining(" "));
event.getChannel().sendFile(ImageActionCmd.CACHE.getInput("http://imgur.com/yFGHvVR.gif"), "mew.gif", new MessageBuilder().append(EmoteReference.TALKING).append(String.format("%s *is meowing at %s.*", event.getAuthor().getAsMention(), mew)).build()).queue();
} else {
event.getChannel().sendFile(ImageActionCmd.CACHE.getInput("http://imgur.com/yFGHvVR.gif"), "mew.gif", new MessageBuilder().append(":speech_balloon: Meow.").build()).queue();
}
}
@Override
public MessageEmbed help(GuildMessageReceivedEvent event) {
return helpEmbed(event, "Meow command").setDescription("**Meow either to a person or the sky**.").setColor(Color.cyan).build();
}
});
registry.registerAlias("meow", "mew");
}
Aggregations