Skip to content

Instantly share code, notes, and snippets.

View itsmefox's full-sized avatar
🦊
If you can be a Fox

itsmefox itsmefox

🦊
If you can be a Fox
View GitHub Profile
@itsmefox
itsmefox / BasicBotApplication.kt
Last active May 20, 2022 08:35
Creating a Discord Bot with Kotlin - BasicBotApplication - 1
class BasicBotApplication {
companion object {
@JvmStatic
fun main(args: Array<String>) {
val token = ""
//Create a new JDA instance
val jda = JDABuilder.createDefault(token).build()
@itsmefox
itsmefox / BasicBotApplication.kt
Last active May 20, 2022 08:52
Creating a Discord Bot with Kotlin - BasicBotApplication - 2
class BasicBotApplication {
companion object {
@JvmStatic
fun main(args: Array<String>) {
val token = ""
//Create a new JDA instance
val jda = JDABuilder.createDefault(token)
.addEventListeners(PingCommand())
.build()
@itsmefox
itsmefox / discord_app_protocols.md
Created May 23, 2022 12:52 — forked from ghostrider-05/discord_app_protocols.md
An unofficial list of discord app protocols

Discord app protocols

Home:

  • /: discord://-/
  • friends: discord://-/channels/@me/
  • nitro: discord://-/store

General:

@itsmefox
itsmefox / PingCommand.kt
Last active November 23, 2022 16:08
Creating a Discord Bot with Kotlin - PingCommand
class PingCommand : ListenerAdapter() {
private val logger: Logger = LoggerFactory.getLogger(javaClass)
//This gets called when a slash command gets used.
override fun onSlashCommandInteraction(event: SlashCommandInteractionEvent) {
//Check if this is our /ping command
if (event.name == "ping") {
logger.info("Command /ping got used")
@itsmefox
itsmefox / Application.java
Created June 22, 2022 12:30
Creating a Discord Bot with Kotlin - Application - 1
public class Application {
public static void main(String[] args) throws LoginException {
String token = "";
//Create a new JDA instance
JDA jda = JDABuilder.createDefault(token).build();
//Set the activity to "I'm Ready"
jda.getPresence().setActivity(Activity.playing("I'm Ready"));
@itsmefox
itsmefox / Application.java
Created June 22, 2022 12:32
Creating a Discord Bot with Kotlin - Application - 2
public class Application {
public static void main(String[] args) throws LoginException {
String token = "";
//Create a new JDA instance
JDA jda = JDABuilder.createDefault(token)
.addEventListeners(new PingCommand()) //Register our /ping Command
.build();
@itsmefox
itsmefox / PingCommand.java
Last active November 23, 2022 16:04
Creating a Discord Bot with Kotlin - PingCommand
public class PingCommand extends ListenerAdapter {
private Logger logger = LoggerFactory.getLogger(this.getClass());
//This gets called when a slash command gets used.
@Override
public void onSlashCommandInteraction(@NotNull SlashCommandInteractionEvent event) {
//Check if this is our /ping command
if (event.getName().equals("ping")) {
logger.info("Command /ping got used");
@itsmefox
itsmefox / BotApplication.kt
Created November 24, 2022 15:08
Create your Discord Bot with aluna-spring-boot-starter - Application
@SpringBootApplication
open class BotApplication {
companion object {
@JvmStatic
fun main(args: Array<String>) {
runApplication<BotApplication>(*args)
}
}
}
@itsmefox
itsmefox / application.yaml
Created November 24, 2022 15:39
Create your Discord Bot with aluna-spring-boot-starter - application.yaml
aluna:
discord:
application-id:
token:
logging:
level:
io.viascom.discord.bot.aluna.AlunaAutoConfiguration: DEBUG
io.viascom.discord.bot.aluna.SlashCommandInteractionInitializer: DEBUG
io.viascom.discord.bot.aluna.ListenerRegistration: DEBUG
@itsmefox
itsmefox / aluna-log-output.txt
Last active November 24, 2022 15:47
Create your Discord Bot with aluna-spring-boot-starter - log output 1
_ _ ____ _ _ ____ _
/ \ | |_ _ _ __ __ _ | _ \(_)___ ___ ___ _ __ __| | | __ ) ___ | |_
/ _ \ | | | | | '_ \ / _` | | | | | / __|/ __/ _ \| '__/ _` | | _ \ / _ \| __|
/ ___ \| | |_| | | | | (_| | | |_| | \__ \ (_| (_) | | | (_| | | |_) | (_) | |_
/_/ \_\_|\__,_|_| |_|\__,_| |____/|_|___/\___\___/|_| \__,_| |____/ \___/ \__|
Aluna: 0.0.32_5.0.0-alpha.22-SNAPSHOT
Spring-Boot: 2.7.0
JDA: 5.0.0-alpha.22