Make "…" trigger a note
Opened this issue · 1 comments
Some keyboards like to do this symbol instead of ...
.
After looking in the code this may be a bit harder to implement
command :note, {
aliases: %i[n ..],
The aliases part relies on there already being a period at the beginning, but since this is a unicode character this is not the case. The only way it seems would be to rewrite the aliases bit to not always expect there to be a period at the beginning, which would also mean rewriting many commands.
I have no idea how the command system works internally and I cannot find much information about it, however it is possible that it is baked into discordrb which would be a bit more annoying.
Closest I could find is this, however as I do not know ruby I am unsure.
ⓘ Jump to line
# A command that references another command
class CommandAlias
# @return [Symbol] the name of this alias
attr_reader :name
# @return [Command] the command this alias points to
attr_reader :aliased_command
def initialize(name, aliased_command)
@name = name
@aliased_command = aliased_command
end
end
I cannot help with actually developing this much as ruby does not want to work for me, however I can still write (some) code.
The command system is indeed baked into discordrb. I basically had to read the source code to understand it.
I could add this feature in a different way, though, by moving the command logic into a separate method, and adding a message event handler that runs on messages starting with …
.