tterrag1098 / k9 Goto Github PK
View Code? Open in Web Editor NEWA Discord bot with some useful commands.
Home Page: http://tterrag.com/k9/
License: MIT License
A Discord bot with some useful commands.
Home Page: http://tterrag.com/k9/
License: MIT License
Listen channels for message modification and save differences in dedicated channel.
As the title says, it would be great if we could see the winning quote in chat and the amount of votes for/against while the voting for death or spare is still active.
Perhaps where the arrow is it could say something like ... "against Quote # by x votes`. It would be nice to be able to see the quote which was deemed better than the one that lost and by how much.
I'm self hosting this bot. Today it broke, so i restarted it, but it didn't help.
I updated it to 0.6.0-367, but it still doesn't work.
I guess it's related to mappings website shutdown, right?
How can i fix this issue?
!mcp func_151000_E
BOT K9: Unexpected error processing command: No such srg version: Unknown
Tagging @k9 in !slap does not slap the user
Show field type in mcpf
command output.
May be useful
https://github.com/tterrag1098/K9/blob/master/src/main/java/com/tterrag/k9/commands/CommandCustomPing.java#L81
Looks like things like emoji and channel names trigger pings. It's very annoying when someone does <:any_string_they_want:emote id>
since the Discord client renders the emoji but you get the ping
After bot update, i noticed that mappings response is plain text.
Is it possible to switch to embeds as it was in older versions?
There is no timeout for the regex matching here, leaving the bot vulnerable to malicious regexes that take excessive time to evaluate.
Since 19w36a, Mojang has released proguard obfuscation map. The map allows for "private use" and disallows any distribution.
So two questions:
I'm running 0.6.0-358
User: !mcpm getAliases 1.12.2
K9: Unexpected error processing command: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
The discord token is on the command line, bare. This could be considered a security risk and is generally incompatible with things like docker secrets (without hacks).
Allow passing a file containing the secret instead, for much securityness..
Another reminder to myself to look into this.
I booted it up like normal, but after listing the servers it's in..
16:01:47 [boundedElastic-6] com.tterrag.k9.K9 Guinevere Central
16:01:47 [boundedElastic-6] com.tterrag.k9.K9 yeetum-bots
16:01:47 [boundedElastic-6] com.tterrag.k9.K9 The Dugre project
16:01:47 [boundedElastic-6] com.tterrag.k9.K9 Bolb Quarantine
16:01:47 [boundedElastic-6] com.tterrag.k9.K9 Gemwire Randomness
16:01:47 [boundedElastic-6] com.tterrag.k9.K9 Curle Army
16:02:17 [parallel-5] c.t.k.c.a.CommandRegistrar Saving all command data.
16:07:17 [parallel-5] c.t.k.c.a.CommandRegistrar Saving all command data.
It dropped off the user list and doesn't respond to commands.
Thread dump says that all threads are deadlocked, waiting for each other.
https://paste.gemwire.uk/view/raw/504a12ca
K9 has got Yarn, K9 Has got MCP. When will K9 get Mojang Mappings?
https://gist.github.com/phit/31feb41cd9d1ced92d620b5fd48ba005
Not sure whats going on, I guess discord is having issues? This is the second time I had to
kill -9 pid
the process, as it wasn't responding to ctrl C or sending sigterm.
I was running build 236, updated to 240 as I saw D4J was updated, not sure if that will fix it. Figured I'll make an issue anyway if it doesn't.
Currently bot has hardcoded admin id, can this be changed?
like a quote
Feature request: automatically quote anything reacted to with ๐พ (or a custom "quote" emoji if you want to get fancy).
I think that K9 should delete any message that it sends if reacted to with โ.
Example (In sponge discord): https://discordapp.com/channels/142425412096491520/401643018773463040/591169260684836869 (and a few messages above)
Dunno why, but the bot is reportin "incorrect number of arguments".
creating a trick like:
!trick -at clj trickname (throw (Exception. "Hi"))
will output:
Error evaluating trick: null
whereas
!clj (throw (Exception. "Hi"))
will output the expected
Could not process command: java.security.PrivilegedActionException: java.lang.Exception: Hi
(Idea from BobbyTablesBot on Reddit.)
Suggestion: If a user ran !xkcd 303
, K9 would post the link to xkcd 303 in the chat (keeping the embed). Same if they ran !xkcd Compiling
or !xkcd compiling
.
No idea how hard this would be to implement, but it'd be really neat ๐
The bot fails to start.
Version: 0.6.0-364-all
Log output: https://pastebin.com/fJU8swu6
!yc
means !lookup_class
mcage
can be m_cage
or mc_age
)!help
command doesn't do what help commands normally do (That's put under !commands
for some reason, which does what !list
would normally do)!commands
does not provide any description of what any of the commands actually do.Suggested changes:
!commands
-> help
(and add descriptions as per !help [command]
(keep originals as aliases)
!yc
-> !class
!ym
-> !method
!yf
-> !field
!yp
-> !param
!clj
-> !eval
!mcage
-> !mc_age
!yv
-> !yarn_version
!lmgtfy
(imgur?) -> !google
Input: ?trick echo 4D
Expected output: ("4D")
actual output: Error evaluating trick: Invalid number: 4D
JDA>Discord4J
:^)
The trick prefix is mildly irritating when you forget if it's ?!
or !?
Can we instead change it to a double prefix? e.g. if your commands are configured to use ! the trick shortcut is !! ?
Otherwise just being able to configure prefixes for tricks would be cool.
Pings with the !ping
command ping you even while you're actively engaged in conversation. Instead, K9 should check if you've been active in the channel in the last couple of minutes and only ping if you haven't.
Just a quick feature idea i had today, this could be implemented in multiple ways, here's a couple:
Allow the creation of a channel (similar to the !info
command) that contains a current list of Tricks registered with the bot and their output, have this list update whenever a trick is updated
Add a flag to the trick execution command to allow it to remain "updated", so whenever the command is updated the output is also updated.
Similar to 1, but allow for only select tricks in the channel (to avoid "prank" tricks/etc in the channel)
TO REPRODUCE:
Use the command !moj bon.a, and notice how there is only one of
method instead of the multiple that are there
I miss the old feature from the chisel IMC where if two people typed o/
or \o
in a row, the bot would mention the high five and increment their counter. Would be a nice feature to include in K9
A trick like
;;start of trick
(+ 1 1)
;;end of trick, we have calculated 1 + 1
Will cause an EOF error despite being, as far as I know, valid clojure
Would it be possible to add support for spigot's mappings as well? This discord bot seems very useful, but the thing is I would need to be able to use spigot's mappings as well. Is this something that could possibly be added?
I got this error:
14:21:02 [elastic-2] i.n.u.i.NativeLibraryLoader Unable to load the library 'netty_transport_native_epoll_x86_64', trying other loading mechanism.
java.lang.UnsatisfiedLinkError: no netty_transport_native_epoll_x86_64 in java.library.path
Is it still needed? My old command line has it
Doing !yc Feature
puts the class whose name is exactly Feature
on the 10th page...
For some reason, K9 started sending ping notifications seemingly matching the regex /.*/
to guild channels in Fabric discord. We have no idea why or how it started doing this
Add a !react command that takes a message link and emoji name as a parameter, and adds the reaction to the message, then removes it after 30 seconds. During this time, the person who used the command can click the reaction and add theirs, allowing non-nitro users to react with any emoji from a server K9 is on.
For documentation, telling the purpose, or anything like that. Could be done with an --add-info flag or something. I dunno I haven't given it too much thought.
Currently, from my reading of the code and anecdotal evidence from cpw's last updating of the #rules channel on Forgecord, whenever a channel is updated using K9's info
command, it pings any users or roles within the message text (excluding embeds, because pings do not work in embeds).
This presents a difficulty whenever a server owner or administrator is updating such channels using the info
command and the text contains mentions of roles or users (such as listing the staff roles of the server), because any update will cause a ping to be sent to all users, which means that server owners/administrators have to coordinate with these pinged users to make sure they know that this ping is due to an update of the rules channel (to avoid inciting irritation or anger from those users who hate pings with a passion unrivaled).
However, I have found a solution residing in the Discord Developer documentation for Channels, for the Allowed Mentions Object.
The Allowed Mentions object in messages allows granular control whether what mentions in a message will actually cause a ping to be sent to users. It allows controlling mentions for: roles, users, @everyone
/@here
, specific roles, and specific users.
As a side effect, it also disables the yellow background in messages with pings.
Discord4J implements this through MessageCreateSpec#setAllowedMentions(AllowedMentions)
, taking in an AllowedMentions
object, built using its own Builder
class which defaults to (to my understanding) an empty AllowedMentions
object which prevents all mentions from becoming pings.
As a reference, JDA implements this feature through MessageAction#allowedMentions(Collection<Message.MentionType>)
and other related methods when sending messages. To implement this in my bot, I have passed in an empty collection, and the results of that are shown above.
This feature will be very useful to servers that use K9's info
command to manage rules channels, so their owners/administrators can update the rules for e.g. spelling mistakes or minor clarifications, without having to ping and disturbed those mentioned users/roles. (cough Forgecord cough)
This issue exists mostly as a reminder to myself to look into this later.
While browsing the list of quotes in the Forge server, the X disappeared!
https://discord.com/channels/313125603924639766/540691915373412393/780213820110012446
I have no idea what caused it.
Pretty simple, allow for tricks to have aliases. One thing that commonly tricks me up is a trick name being plural or not. Having aliases would be useful to solve this
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.