no output on local slash commands when user taps instead of using physical keyboard #26

Open
opened 2019-06-16 19:14:42 +00:00 by a · 1 comment
Owner

tap button likely has a second hook

tap button likely has a second hook
a added the
bug
help wanted
labels 2020-07-31 14:14:08 +00:00
Contributor

what about adding ctc slashcommands to autocomplete? i added test command by adding

    const-string v2, "test"

    const-string v3, "test"

    invoke-static {v2, v3, v4, v1}, Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel;->createSlashCommand(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/discord/widgets/chat/input/WidgetChatInputSlashAction;)Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel;

    move-result-object v2

    invoke-virtual {v0, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

to com/discord/widgets/chat/input/WidgetChatInputCommandsModel.smali createCommandsForSlash

only one problem with it: sends command output as user, but i believe that we can make it to send as clyde.

(v2 - command name, v3 - command output, v4 - (nullable) command description; command output is string, but we can patch

.method public static synthetic h(Ljava/lang/String;Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel;)Ljava/lang/String;
    .locals 2

    .line 1
    iget-object v0, p1, Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel;->tag:Ljava/lang/String;

    const-string v1, ""

    invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object p0

    .line 2
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const/16 p0, 0x20

    invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;

    iget-object p0, p1, Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel;->slashOutput:Ljava/lang/String;

    invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p0

    return-object p0
.end method

to handle args)

what about adding ctc slashcommands to autocomplete? i added test command by adding ```smali const-string v2, "test" const-string v3, "test" invoke-static {v2, v3, v4, v1}, Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel;->createSlashCommand(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/discord/widgets/chat/input/WidgetChatInputSlashAction;)Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel; move-result-object v2 invoke-virtual {v0, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z ``` to `com/discord/widgets/chat/input/WidgetChatInputCommandsModel.smali` `createCommandsForSlash` only one problem with it: sends command output as user, but i believe that we can make it to send as clyde. (v2 - command name, v3 - command output, v4 - (nullable) command description; command output is string, but we can patch ```smali .method public static synthetic h(Ljava/lang/String;Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel;)Ljava/lang/String; .locals 2 .line 1 iget-object v0, p1, Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel;->tag:Ljava/lang/String; const-string v1, "" invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; move-result-object p0 .line 2 new-instance v0, Ljava/lang/StringBuilder; invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; const/16 p0, 0x20 invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder; iget-object p0, p1, Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel;->slashOutput:Ljava/lang/String; invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p0 return-object p0 .end method ``` to handle args)
This repo is archived. You cannot comment on issues.
No milestone
No project
No assignees
2 participants
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: distok/cutthecord#26
No description provided.