MCPcopy Create free account
hub / github.com/Java-Discord/JavaBot / onApplicationEvent

Method onApplicationEvent

src/main/java/net/discordjug/javabot/Bot.java:71–87  ·  view source on GitHub ↗

Initializes Sentry, interactions and listeners.

(ApplicationReadyEvent event)

Source from the content-addressed store, hash-verified

69 * Initializes Sentry, interactions and listeners.
70 */
71 @Override
72 public void onApplicationEvent(ApplicationReadyEvent event) {
73 Sentry.init(options -> {
74 options.setDsn(config.getSystems().getSentryDsn());
75 options.setTracesSampleRate(1.0);
76 options.setDebug(false);
77 });
78 if (!commands.isEmpty()) {
79 dih4jda.addSlashCommands(commands.toArray(SlashCommand[]::new));
80 }
81 if (!contextCommands.isEmpty()) {
82 dih4jda.addContextCommands(contextCommands.toArray(ContextCommand[]::new));
83 }
84 dih4jda.registerInteractions();
85 addEventListeners(listeners);
86 registerComponentHandlers(ctx);
87 }
88
89 /**
90 * The main method that starts the bot. This involves a few steps:

Callers

nothing calls this directly

Calls 4

addEventListenersMethod · 0.95
getSystemsMethod · 0.80
initMethod · 0.45

Tested by

no test coverage detected