The main method that starts the bot. This involves a few steps: Setting the time zone to UTC, to keep our sanity when working with times. Loading the configuration JSON file. Creating and configuring the net.dv8tion.jda.api.JDA instance that enables the
(String[] args)
| 100 | * @throws Exception If any exception occurs during bot creation. |
| 101 | */ |
| 102 | public static void main(String[] args) throws Exception { |
| 103 | TimeZone.setDefault(TimeZone.getTimeZone(ZoneOffset.UTC)); |
| 104 | MessageRequest.setDefaultMentions(EnumSet.of(Message.MentionType.CHANNEL, Message.MentionType.USER, Message.MentionType.EMOJI)); |
| 105 | SpringApplication.run(Bot.class, args); |
| 106 | } |
| 107 | |
| 108 | private void registerComponentHandlers(@NotNull ApplicationContext ctx) { |
| 109 | Map<String, Object> interactionHandlers = ctx.getBeansWithAnnotation(AutoDetectableComponentHandler.class); |