Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Kyro

A simple music bot written in Kotlin

Logo

Note: This is entirely open source and is in no case under any sort of warranty and special service

Where is the code?

Each of the code commits are seperated by version you can find the code by clicking the top branch and selecting the different version based on what your needs are.

Adding Your OWN Commands

Whats the structure?

class <Your class here> : Command() 
{
override fun execute(event: CommandEvent)  
{
// Example defines
  val channel = event.channel
  val message = event.message

// Your other code here

}
init {
name = "<Command Name>" // String
aliases = arrayOf("<alias>" ,"<alias>") // Array String
help = "<Help Message>" // String
guildOnly = <Boolean> // true (Command can only be used in guild) / false (Command can be used in private messaging and guild)
arguments = getArguments()
cooldown = <int seconds> // 1 2 3
requiredRole = "<Role Name>" // String
	}
}

Example

class Skip : Command() {  
  
  override fun execute(event: CommandEvent) {  
  val channel = event.textChannel  
  val playerManager = instance  
  val GMM = playerManager!!.getGuildMusicManager(event.guild)  
  val s = GMM.scheduler  
  val player = GMM.audioPlayer  
  
s.isRepeating = true  
if (event.guild.roles.stream().noneMatch{r: Role -> r.name.equals("DJ", ignoreCase = true)}) {  
  event.reply("Seems like a DJ role didn't exist so i've created one for you.")  
  event.guild.createRole().setName("DJ").setColor(Color.CYAN).queue()  
}  
  if (event.member.roles.stream().noneMatch { r: Role -> r.name.equals("DJ", ignoreCase = true) or !event.isOwner or !event.member.hasPermission(Permission.ADMINISTRATOR) }) {  
  event.textChannel.sendMessage("You need the role `DJ` for that!").queue()  
  return  
  
  }  
  if (player.playingTrack == null) {  
  channel.sendMessage("Can't skip when no track is playing!").queue()  
  return  
  }  
  s.nextTrack()  
  channel.sendMessage("Skipped.").queue()  
  
 }  init {  
  name = "skip"  
  aliases = arrayOf("s")  
  help = "Skips the currently playing track"  
  }  
}

Q & A

Q: Who's the command handler your using made by?

Great question! The command handler is made by @jagrosh and the package is JDA-Utilities

Q: What are the rules for submitting pull requests?

The rules for submitting a pull request are the following:

You must have at least 50 lines changed

You must have changed something other than grammatical errors (i.e Fixing documentation)

That's it for now :3

About

A basic music bot with easy to addon modules

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors