Search in sources :

Example 1 with SimpleFileDataManager

use of net.kodehawa.mantarobot.utils.data.SimpleFileDataManager in project MantaroBot by Mantaro.

the class InfoCmds method tips.

@Subscribe
public void tips(CommandRegistry cr) {
    final List<String> tips = new SimpleFileDataManager("assets/mantaro/texts/tips.txt").get();
    final Random r = new Random();
    cr.register("tips", new SimpleCommand(Category.INFO) {

        @Override
        protected void call(GuildMessageReceivedEvent event, String content, String[] args) {
            event.getChannel().sendMessage(EmoteReference.TALKING + "Tip: " + tips.get(r.nextInt(tips.size()))).queue();
        }

        @Override
        public MessageEmbed help(GuildMessageReceivedEvent event) {
            return helpEmbed(event, "Tips Command").setDescription("**Shows tips about the bot!**").build();
        }
    });
    cr.registerAlias("tips", "bottips");
}
Also used : SimpleCommand(net.kodehawa.mantarobot.core.modules.commands.SimpleCommand) GuildMessageReceivedEvent(net.dv8tion.jda.core.events.message.guild.GuildMessageReceivedEvent) SimpleFileDataManager(net.kodehawa.mantarobot.utils.data.SimpleFileDataManager) Subscribe(com.google.common.eventbus.Subscribe)

Aggregations

Subscribe (com.google.common.eventbus.Subscribe)1 GuildMessageReceivedEvent (net.dv8tion.jda.core.events.message.guild.GuildMessageReceivedEvent)1 SimpleCommand (net.kodehawa.mantarobot.core.modules.commands.SimpleCommand)1 SimpleFileDataManager (net.kodehawa.mantarobot.utils.data.SimpleFileDataManager)1