GithubHelp home page GithubHelp logo

geysermc / geyserdiscordbot Goto Github PK

View Code? Open in Web Editor NEW
23.0 23.0 39.0 2.95 MB

A bot for the GeyserMC Discord server

Home Page: https://geysermc.org

License: MIT License

Java 98.41% FreeMarker 1.48% Dockerfile 0.11%
discord-bot hacktoberfest

geyserdiscordbot's People

Contributors

7man7lmyt avatar basaigh avatar blankcod3 avatar camotoy avatar chew avatar cloudyork avatar cybornut avatar dependabot[bot] avatar dhwanishshah avatar drakon64 avatar easyclifton avatar gaming32 avatar greaper88 avatar heath123 avatar imdabigboss avatar jackson-57 avatar jens-co avatar kas-tle avatar konicai avatar mrzomka avatar notnotnotswipez avatar onebeastchris avatar redned235 avatar rtm516 avatar themonbongh avatar tim203 avatar toinouh avatar tydium avatar yhdiamond avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

geyserdiscordbot's Issues

Feature Request: Server status command.

So I was thinking that you could add a server status command so you can detect what servers MOTD/Player Count/ Server Software. This command can detect both java and bedrock servers. I saw this idea in another server and thought it would be a nice fit for the bot.

Example Usage:
Java:
!status play.tydiumcraft.tk

Output:
Screenshot_20210409-162104_Discord.jpg

Bedrock (No server Icon):
!status be.tydiumcraft.tk:19132

Output:
Screenshot_20210409-162125_Discord.jpg

Bedrock (with server icon):
!status be.tydiumcraft.tk:25562

Output:
Screenshot_20210409-162136_Discord.jpg

I hope this would be a nice fit for the bot in your eyes. Hope you enjoy!

Feature Request: Warnings for javassist

Every time someone mentions javassist in a support channel, the Geyser bot should warn them and say "Geyser does not use javassist, you probably have a pirated plugin installed!".

Error Analyzer - NumberFormatException: Cannot parse null string

Sentry Issue: GEYSERDISCORDBOT-3A

NumberFormatException: Cannot parse null string
    at java.lang.Integer.parseInt(Integer.java:630)
    at java.lang.Integer.parseInt(Integer.java:786)
    at org.geysermc.discordbot.listeners.ErrorAnalyzer.errorHandler(ErrorAnalyzer.java:233)
    at org.geysermc.discordbot.listeners.ErrorAnalyzer.handleLog(ErrorAnalyzer.java:177)
    at org.geysermc.discordbot.listeners.ErrorAnalyzer.onMessageReceived(ErrorAnalyzer.java:123)
...
(19 additional frame(s) were not displayed)

One of the EventListeners had an uncaught exception

From: proxy.log

Ping command throwing IllegalArgumentException

Sentry Issue: GEYSERDISCORDBOT-7S

IllegalArgumentException: Value cannot be longer than 1024 characters.
    at net.dv8tion.jda.api.entities.MessageEmbed$Field.<init>(MessageEmbed.java:989)
    at net.dv8tion.jda.api.entities.MessageEmbed$Field.<init>(MessageEmbed.java:1011)
    at net.dv8tion.jda.api.EmbedBuilder.addField(EmbedBuilder.java:851)
    at org.geysermc.discordbot.commands.PingCommand.handle(PingCommand.java:176)
    .addField("Java", javaInfo, false)
    at org.geysermc.discordbot.commands.PingCommand.execute(PingCommand.java:77)
    interactionHook.editOriginalEmbeds(handle(ip)).queue();
...
(22 additional frame(s) were not displayed)

Exception caught running command ping

Invalid or missing dumps causing errors

Sentry Issue: GEYSERDISCORDBOT-C

JSONException: JSONObject["config"] not found.
    at org.json.JSONObject.get(JSONObject.java:572)
    at org.json.JSONObject.getJSONObject(JSONObject.java:782)
    at org.geysermc.discordbot.listeners.DumpHandler.onMessageReceived(DumpHandler.java:125)
    at net.dv8tion.jda.api.hooks.ListenerAdapter.onEvent(ListenerAdapter.java:463)
    at net.dv8tion.jda.api.hooks.InterfacedEventManager.handle(InterfacedEventManager.java:96)
...
(16 additional frame(s) were not displayed)

One of the EventListeners had an uncaught exception

Idea: Error analysis

  • Responds to common errors, like address in use errors
  • Tells people when errors probably aren't caused by Geyser (when org.geysermc isn't mentioned in the stack trace)
  • Send a link to the file and line the error comes from, to helps devs troubleshoot the problem
  • Searches existing GitHub issues for the error

InteractionExpiredException: The interaction has expired and can no longer be responded to!

Sentry Issue: GEYSERDISCORDBOT-6D

ContextException: None
    at net.dv8tion.jda.api.exceptions.ContextException.here(ContextException.java:54)
    at net.dv8tion.jda.api.requests.Request.<init>(Request.java:77)
    at net.dv8tion.jda.internal.requests.RestActionImpl.queue(RestActionImpl.java:197)
    at net.dv8tion.jda.internal.requests.restaction.TriggerRestAction.queue(TriggerRestAction.java:105)
    at net.dv8tion.jda.api.requests.RestAction.queue(RestAction.java:572)
...
(24 additional frame(s) were not displayed)

InteractionExpiredException: The interaction has expired and can no longer be responded to!
    at net.dv8tion.jda.internal.interactions.InteractionHookImpl.checkExpired(InteractionHookImpl.java:191)
    at net.dv8tion.jda.internal.requests.RestActionImpl$CheckWrapper.test(RestActionImpl.java:334)
    at net.dv8tion.jda.internal.requests.RestActionImpl$CheckWrapper.getAsBoolean(RestActionImpl.java:340)
    at net.dv8tion.jda.api.requests.Request.runChecks(Request.java:236)
    at net.dv8tion.jda.api.requests.Request.isSkipped(Request.java:221)
...
(8 additional frame(s) were not displayed)

RestAction queue returned failure

Feature Request: More accurate regex for profanity filter

hey! it seems like that the bot doesn't detect profanity in URLs because of the regex.
Testing with new RegExp(`(?:|\W)foo(?:|\W)`) instead of new RegExp(`(^| )${Utils.escapeRegExp(newWord)}( |$)`) seems to work and detect URLs

Idea: Restart command

(idea by @rtm516)
Add !restart to quit the bot (pm2 will auto-restart it) and !pull-and-restart to pull the latest changes from GitHub

CommandErrorHandler doesn't support deferred interactions

Sentry Issue: GEYSERDISCORDBOT-7R

IllegalStateException: This interaction has already been acknowledged or replied to. You can only reply or acknowledge an interaction once!
    at net.dv8tion.jda.internal.requests.restaction.interactions.InteractionCallbackImpl.tryAck(InteractionCallbackImpl.java:57)
    at net.dv8tion.jda.internal.requests.restaction.interactions.InteractionCallbackImpl.queue(InteractionCallbackImpl.java:64)
    at net.dv8tion.jda.api.requests.RestAction.queue(RestAction.java:572)
    at net.dv8tion.jda.api.requests.RestAction.queue(RestAction.java:538)
    at org.geysermc.discordbot.listeners.CommandErrorHandler.onSlashCommandException(CommandErrorHandler.java:58)
    .build()).setEphemeral(true).queue();
...
(22 additional frame(s) were not displayed)

RestAction queue returned failure

Feature request: Delete hastebins when file they were generated from is removed.

Earlier in geyser discord someone posted a geyser config with their java details in it by accident, and immediately removed the file once they realized their mistake. Except, Geyser bot had made a hastebin, and it took another minute for the hastebin to be manually removed. Could we make the bot automatically delete the hastebin message when the file it was generated from gets deleted?

Feature Request: Reformat mclo.gs links to raw

When a user pates a link to mclo.gs, it would be nice if the bot in turn pasted a link to the raw version of that log, as the site tends to be quite heavy for what it's ultimately trying to do: displaying logs.

It would search for something like https:\/\/mclo\.gs\/([A-Z,a-z,0-9]{7})

And then return: https://api.mclo.gs/1/raw/$1

Idea: Port forwarding checking command

Add a command like !pfcheck ip:port or/and !pf ip:port to easily check port forwarding on a specific server.
Maybe also automatically detect server IPs and Adresses with "not working" context and check port forwarding for them. If it is an alphaberic adress detect if its anything than an A record and add a note about it.

Idea: Auto add aliases for tags

If a tag command is run, and there isn't a valid tag, then another tag command is run, and it is a valid tag, the bot should maybe add an alias for the second tag? Maybe only if this happens multiple times, or if a helpful+ approves.

ErrorResponseException: 10008: Unknown Message

Sentry Issue: GEYSERDISCORDBOT-7P

ContextException: None
    at net.dv8tion.jda.api.exceptions.ContextException.here(ContextException.java:54)
    at net.dv8tion.jda.api.requests.Request.<init>(Request.java:77)
    at net.dv8tion.jda.api.requests.RestFuture.<init>(RestFuture.java:40)
    at net.dv8tion.jda.internal.requests.RestActionImpl.submit(RestActionImpl.java:209)
    at net.dv8tion.jda.internal.requests.RestActionImpl.complete(RestActionImpl.java:219)
...
(21 additional frame(s) were not displayed)

ErrorResponseException: 10008: Unknown Message
    at net.dv8tion.jda.internal.requests.RestActionImpl.complete(RestActionImpl.java:227)
    at net.dv8tion.jda.api.requests.RestAction.complete(RestAction.java:632)
    at org.geysermc.discordbot.listeners.DeleteHandler.onMessageDelete(DeleteHandler.java:44)
    message.delete().complete();
    at net.dv8tion.jda.api.hooks.ListenerAdapter.onEvent(ListenerAdapter.java:446)
    at net.dv8tion.jda.api.hooks.InterfacedEventManager.handle(InterfacedEventManager.java:96)
...
(17 additional frame(s) were not displayed)

One of the EventListeners had an uncaught exception

RejectedExecutionException: Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@277bf091[Not completed,...

Sentry Issue: GEYSERDISCORDBOT-7X

RejectedExecutionException: Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@277bf091[Not completed, task = java.util.concurrent.Executors$RunnableAdapter@6eb17ec8[Wrapped task = org.geysermc.discordbot.updates.UpdateManager$$Lambda$434/0x00007fb24b3b95f8@730f9695]] rejected from java.util.concurrent.ScheduledThreadPoolExecutor@fab35b1[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
    at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2065)
    at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:833)
    at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:340)
    at java.util.concurrent.ScheduledThreadPoolExecutor.scheduleAtFixedRate(ScheduledThreadPoolExecutor.java:632)
    at org.geysermc.discordbot.updates.UpdateManager.setup(UpdateManager.java:63)
    GeyserBot.getGeneralThreadPool().scheduleAtFixedRate(UpdateManager::doUpdates, 60L, 60L, TimeUnit.SECONDS);
...
(1 additional frame(s) were not displayed)

Feature Request: Support timeouts

Discord's semi-recent 'timeout' feature is currently unsupported by the bot. Similar to kicks and bans, timeouts should be logged in the specified log channel.
A timeout command could also be added, like kicks and bans have. I believe the API allows us to time out users for longer than the official client normally allows us to (28 days instead of 7).

IllegalArgumentException: Cannot create file when running in docker container

Sentry Issue: GEYSERDISCORDBOT-4G

IOException: Permission denied
    at java.io.UnixFileSystem.createFileExclusively(UnixFileSystem.java)
    at java.io.File.createNewFile(File.java:1043)
    at net.dv8tion.jda.api.entities.Message$Attachment.downloadToFile(Message.java:2492)
    at net.dv8tion.jda.api.entities.Message$Attachment.downloadToFile(Message.java:2450)
    at net.dv8tion.jda.api.entities.Message$Attachment.downloadToFile(Message.java:2411)
...
(20 additional frame(s) were not displayed)

IllegalArgumentException: Cannot create file
    at net.dv8tion.jda.api.entities.Message$Attachment.downloadToFile(Message.java:2498)
    at net.dv8tion.jda.api.entities.Message$Attachment.downloadToFile(Message.java:2450)
    at net.dv8tion.jda.api.entities.Message$Attachment.downloadToFile(Message.java:2411)
    at org.geysermc.discordbot.listeners.FileHandler.onMessageReceived(FileHandler.java:85)
    at net.dv8tion.jda.api.hooks.ListenerAdapter.onEvent(ListenerAdapter.java:424)
...
(18 additional frame(s) were not displayed)

One of the EventListeners had an uncaught exception

NullPointerException

Sentry Issue: GEYSERDISCORDBOT-8

NullPointerException: None
    at org.geysermc.discordbot.listeners.LogHandler.onGuildMessageReceived(LogHandler.java:221)
    at net.dv8tion.jda.api.hooks.ListenerAdapter.onEvent(ListenerAdapter.java:463)
    at net.dv8tion.jda.api.hooks.InterfacedEventManager.handle(InterfacedEventManager.java:96)
    at net.dv8tion.jda.internal.hooks.EventManagerProxy.handleInternally(EventManagerProxy.java:88)
    at net.dv8tion.jda.internal.hooks.EventManagerProxy.handle(EventManagerProxy.java:70)
...
(14 additional frame(s) were not displayed)

One of the EventListeners had an uncaught exception

NumberFormatException with invalid entries for ping command

Sentry Issue: GEYSERDISCORDBOT-7

NumberFormatException: For input string: "//155.93.172.4/"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
    at java.lang.Integer.parseInt(Integer.java:638)
    at java.lang.Integer.parseInt(Integer.java:770)
    at org.geysermc.discordbot.commands.PingCommand.handle(PingCommand.java:105)
    at org.geysermc.discordbot.commands.PingCommand.execute(PingCommand.java:77)
...
(21 additional frame(s) were not displayed)

Exception caught running command ping

IllegalStateException: This message event did not happen in a guild

Sentry Issue: GEYSERDISCORDBOT-80

IllegalStateException: This message event did not happen in a guild
    at net.dv8tion.jda.api.events.message.GenericMessageEvent.getGuild(GenericMessageEvent.java:162)
    at org.geysermc.discordbot.listeners.PreviewHandler.onMessageReceived(PreviewHandler.java:56)
    NewsChannel previewFeedsChannel = ServerSettings.getPreviewFeedsChannel(event.getGuild());
    at net.dv8tion.jda.api.hooks.ListenerAdapter.onEvent(ListenerAdapter.java:446)
    at net.dv8tion.jda.api.hooks.InterfacedEventManager.handle(InterfacedEventManager.java:96)
    at org.geysermc.discordbot.util.SentryEventManager.handle(SentryEventManager.java:45)
    super.handle(event);
...
(16 additional frame(s) were not displayed)

One of the EventListeners had an uncaught exception

SQL Ip never changed from 172.18.0.10

Im trying to setup my sql to the ip 172.17.0.1 so it can actually connect however I've having trouble in the first place since it wants to always use the other ip.

IllegalArgumentException when detected error longer than 256 characters

Sentry Issue: GEYSERDISCORDBOT-A

IllegalArgumentException: Name cannot be longer than 256 characters.
    at net.dv8tion.jda.api.entities.MessageEmbed$Field.<init>(MessageEmbed.java:964)
    at net.dv8tion.jda.api.entities.MessageEmbed$Field.<init>(MessageEmbed.java:988)
    at net.dv8tion.jda.api.EmbedBuilder.addField(EmbedBuilder.java:782)
    at org.geysermc.discordbot.listeners.ErrorAnalyzer.onMessageReceived(ErrorAnalyzer.java:122)
    at net.dv8tion.jda.api.hooks.ListenerAdapter.onEvent(ListenerAdapter.java:463)
...
(17 additional frame(s) were not displayed)

One of the EventListeners had an uncaught exception

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.