kaaz / discordbot Goto Github PK
View Code? Open in Web Editor NEWA Java Discord bot using JDA
License: Apache License 2.0
A Java Discord bot using JDA
License: Apache License 2.0
sometimes when a download fails the db record is made, or the opposite.
figure out whats causing it
and make it so that its self-repairing in the future
Option to have playlists loop over the whole list rather than randomly.
Playlists on shuffle can be a pain, especially on smaller lists.
suggested command:
!playlist playmode <shuffle/loop>
!playlist mode <shuffle/loop>
right now its only possible to have 1 playlist per guild.
Multiple per guild;
Limit it somehow?
Visibility: Who can see/access it?
Personal playlists;
You can use these in any guild
Set who can see/play them?
Modify who can add/remove tracks from it?
play a specific track from the guild-playlist
idea for now:
!pl play
eg.
!pl play 123
Configurable option to enable/disable logging of events such as users joining/leaving
And the ability to configure which channel
Either subscription based or a config toggle
Log role changes, channel creation/deletion
Option to change logging format
such as add/remove time and/or date to the message
!bank and !profile are implemented, yet they don't really do anything.
Provide ways of gaining experience and currency to reward activity
!remind <me/channel>
sends you or your channel a message over x min with
example:
!remind channel 1h Get ready for a practice match!
Will send a message in 1 hour to the channel where the command was executed with the message:
Reminder from [user]! Get ready for a practice match
Ill do !ping no responce i do !play the bot will jo8n and play the music but will not print the song.the bot has full perms
Somehow implement playlists.
Per user? Guild?
Some ideas;
option1
user makes playlist (and is owner)
playlist has an option on playing songs:
option2:
have a playlist on a per-guild basis
anyone with administrator permission can choose if users can add music to the playlist similar to option 1.
option 3:
per-guild playlist, every song gets added automatically to the list, can remove them from their list and nobody even notices that there is a concept for playlists
I've encountered a java.lang.NullPointerException
Accompanied stacktrace:
java.util.Calendar.setTime(Calendar.java:1770)
java.text.SimpleDateFormat.format(SimpleDateFormat.java:943)
java.text.SimpleDateFormat.format(SimpleDateFormat.java:936)
java.text.DateFormat.format(DateFormat.java:345)
emily.db.controllers.CModerationCase.buildCase(CModerationCase.java:148)
emily.db.controllers.CModerationCase.buildCase(CModerationCase.java:139)
emily.command.administrative.modactions.AbstractModActionCommand.execute(AbstractModActionCommand.java:83)
emily.handler.CommandHandler.process(CommandHandler.java:152)
emily.main.DiscordBot.handleMessage(DiscordBot.java:384)
emily.event.JDAEvents.onGuildMessageReceived(JDAEvents.java:234)
net.dv8tion.jda.core.hooks.ListenerAdapter.onEvent(ListenerAdapter.java:387)
emily.event.JDAEventManager.lambda$handle$0(JDAEventManager.java:70)
I've encountered a java.lang.NullPointerException
Accompanied stacktrace:
java.util.Calendar.setTime(Calendar.java:1770)
java.text.SimpleDateFormat.format(SimpleDateFormat.java:943)
java.text.SimpleDateFormat.format(SimpleDateFormat.java:936)
java.text.DateFormat.format(DateFormat.java:345)
emily.db.controllers.CModerationCase.buildCase(CModerationCase.java:148)
emily.db.controllers.CModerationCase.buildCase(CModerationCase.java:139)
emily.command.administrative.modactions.AbstractModActionCommand.execute(AbstractModActionCommand.java:83)
emily.handler.CommandHandler.process(CommandHandler.java:152)
emily.main.DiscordBot.handleMessage(DiscordBot.java:384)
emily.event.JDAEvents.onGuildMessageReceived(JDAEvents.java:234)
net.dv8tion.jda.core.hooks.ListenerAdapter.onEvent(ListenerAdapter.java:387)
emily.event.JDAEventManager.lambda$handle$0(JDAEventManager.java:70)
I've encountered a java.lang.NullPointerException
Accompanied stacktrace:
java.util.Calendar.setTime(Calendar.java:1770)
java.text.SimpleDateFormat.format(SimpleDateFormat.java:943)
java.text.SimpleDateFormat.format(SimpleDateFormat.java:936)
java.text.DateFormat.format(DateFormat.java:345)
emily.db.controllers.CModerationCase.buildCase(CModerationCase.java:148)
emily.db.controllers.CModerationCase.buildCase(CModerationCase.java:139)
emily.command.administrative.modactions.AbstractModActionCommand.execute(AbstractModActionCommand.java:83)
emily.handler.CommandHandler.process(CommandHandler.java:152)
emily.main.DiscordBot.handleMessage(DiscordBot.java:384)
emily.event.JDAEvents.onGuildMessageReceived(JDAEvents.java:234)
net.dv8tion.jda.core.hooks.ListenerAdapter.onEvent(ListenerAdapter.java:387)
emily.event.JDAEventManager.lambda$handle$0(JDAEventManager.java:70)
Log the errors to a channel, or make it a service to subscribe on
Hi, i am using your bot and sometimes she doesn't let me use some commands like reboot and I am the admin of my channel. Can you help me?
Thanks.
An error is occurred when launching.
I think GuildSettings.settings is empty.
GuildSettings.id is 0 and guilds table is also empty.
[05:04:26] [Fatal] [JDA]: One of the EventListeners had an uncaught exception [05:04:26] [Fatal] [JDA]: Encountered an exception: [05:04:26] [Fatal] [JDA]: java.lang.NullPointerException at discordbot.role.RoleRankings.fixRoles(RoleRankings.java:172) at discordbot.main.DiscordBot.markReady(DiscordBot.java:190) at discordbot.event.JDAEvents.onReady(JDAEvents.java:128) at net.dv8tion.jda.hooks.ListenerAdapter.onEvent(ListenerAdapter.java:151) at net.dv8tion.jda.hooks.InterfacedEventManager.handle(InterfacedEventManager.java:64) at net.dv8tion.jda.requests.WebSocketClient.ready(WebSocketClient.java:121) at net.dv8tion.jda.handle.ReadyHandler.finishReady(ReadyHandler.java:146) at net.dv8tion.jda.handle.ReadyHandler.onGuildInit(ReadyHandler.java:123) at net.dv8tion.jda.handle.GuildJoinHandler.lambda$handleInternally$51(GuildJoinHandler.java:44) at net.dv8tion.jda.handle.EntityBuilder.createGuildFirstPass(EntityBuilder.java:250) at net.dv8tion.jda.handle.GuildJoinHandler.handleInternally(GuildJoinHandler.java:38) at net.dv8tion.jda.handle.SocketHandler.handle(SocketHandler.java:38) at net.dv8tion.jda.requests.WebSocketClient.handleEvent(WebSocketClient.java:629) at net.dv8tion.jda.requests.WebSocketClient.onTextMessage(WebSocketClient.java:324) at net.dv8tion.jda.requests.WebSocketClient.onBinaryMessage(WebSocketClient.java:705) at com.neovisionaries.ws.client.ListenerManager.callOnBinaryMessage(ListenerManager.java:368) at com.neovisionaries.ws.client.ReadingThread.callOnBinaryMessage(ReadingThread.java:243) at com.neovisionaries.ws.client.ReadingThread.handleBinaryFrame(ReadingThread.java:937) at com.neovisionaries.ws.client.ReadingThread.handleFrame(ReadingThread.java:696) at com.neovisionaries.ws.client.ReadingThread.main(ReadingThread.java:102) at com.neovisionaries.ws.client.ReadingThread.run(ReadingThread.java:61)
A command that PMs the current song details to the user.
Something along the lines of
!nowplaying tome/pm
sends information about the currently playing track to the user
The playlist command is getting a little too big
great bot, very good work. However, on adding just 1 simple command to the bot for self testing purposes. Every command returns a unknown_command
no matter what. I don't see but 2 or 3 responses to issues here but if anyone else knows what the hell is going on, would love to know.
no sound
I'm using your bot as a playground and wanted to know how you add in new commands?
change the library from jda2 to jda3
when i run it, it only says
Error: Unable to access jarfile Emily-all-1.9.14.jar
and does nothing else.
I've encountered a java.lang.Exception
Message:
No record for file
Extra information:
filename: = F:\aGhUiucRJ2M.opus
plz fix = I want music
Accompanied stacktrace:
emily.handler.MusicPlayerHandler.addToQueue(MusicPlayerHandler.java:525)
emily.command.music.PlayCommand.lambda$null$2(PlayCommand.java:274)
emily.threads.YoutubeThread$YTWorkerWorker.lambda$run$0(YoutubeThread.java:275)
emily.handler.discord.RestTask.lambda$run$0(RestTask.java:49)
java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
java.util.concurrent.FutureTask.run(Unknown Source)
java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
java.lang.Thread.run(Unknown Source)
the commandhandler is growing in size, might have to redo it
Hey my name is RaiderRoss I am currently trying to make a working music bot. In your code I see you are able to search for music. I really want to be able to do that in my code but I have no idea how to integrate it into my methods. If you are willing to help please contact RaiderRoss#6666 on discord.
The rest of the code looks to work but is being skipped because as a user I am not the BOT_ADMIN.
Was this intentional, and if so for what reason, or is this just a mistake, and if so can we get it fixed and released?
A guide to set up the bot. Go though all the options maybe with reactions so the user doesn't have to type anything?
join the user and start playing when issuing the play command with
eg:
!pl play 123
Is it possible to add a whole youtube playlist instead of song by song. Would be nice to be able to do the same with Soundcloud.
Thx
A web interface to make editing the bot more convenient rather than though commands.
More options for skipping a song
Right now if you write !skip, you skip the song
Make the requirement to skip based on the amount of people listening
require x people to skip
or a percentage like 30%+
keywords to the commandadmin command.
eg.
allcommands, musiccommands, funcommands,
That way there is no need to type in every command, if you'd want to disable a command entirely
Build
Type mvn fatJar in the DiscordBot folder. In the build/libs/ folder there should be a file called Emily-all-{VERSION}.jar (where version is the latest version number). Move this file over to a location wherever you want to start the bot from.
Why is there a maven reference in there? When it clearly says in the readme.md I should use Gradle? I tried "mvn fatJar" it said no pom.xml found. seems like it needs a update ;). Gradle ->build ->Jar in Intellij did the job though.
Everything else is unacceptable
The one I would find more interesting is for !np repeat
, but maybe !np clear
, !np source
and !np updatetitle
would be good too.
Edit: another one for !pause
too
The autoranking system is now based on the date when a user first joined the guild.
Base this on user activity instead of join date.
examples;
the ability to vote on music, which can be used later.
Example:
only play songs rated higher than x with more than y votes
!skip option so that only admins can use it
After reboot; rejoin channels and start playing again
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.