Skip to content

Add more features to discord app #1806

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions apps/discord/discord.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ def discord_answer_call():
def discord_decline_call():
"""Decline incoming call"""

def discord_start_call():
"""Start a call in a private DM or group"""

def discord_quick_switcher(dest_type: str, dest_search: str):
"""Open up the quick switcher, optionally specifying a type of destination"""

Expand All @@ -77,9 +80,36 @@ def discord_go_current_call():
def discord_toggle_dms():
"""Toggle between dms and your most recent server"""

def discord_create_join_server():
"""Create or join a new server"""

def discord_toggle_soundboard():
"""Toggle the soundboard while in a call"""

def discord_create_private_group():
"""Create private group"""

def discord_channel_oldest_unread():
"""Go to oldest unread message in channel"""

def discord_open_support():
"""Open the Discord support page in browser"""

def discord_start_lofi():
"""Listen to Lofi beats with Wumpus"""


@ctx.action_class("user")
class UserActions:
# Navigation: Channels
def messaging_open_channel_picker():
actions.user.discord_quick_switcher("#", "")


@ctx.action_class("edit")
class EditActions:
def find_next():
pass

def find_previous():
pass
23 changes: 23 additions & 0 deletions apps/discord/discord.talon
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@ app: discord
-
tag(): user.messaging
tag(): user.emoji
tag(): user.navigation
tag(): user.find

# Messages
# Edit Message: E
# Delete Message: Backspace
# Pin Message: P
# Add Reaction: +
# Reply: R
# Copy Text: CMD+C or Ctrl+C
# Mark Unread: OPT+ENTER
# Focus Text Area: ESC
# Forward Message: F

# Navigation: Messages
go oldest unread: user.discord_channel_oldest_unread()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the community backlog session — this should probably go into messaging.talon and have a syntax more similar to the existing commands for navigating around unread channels.


# Navigation: QuickSwitcher
{user.discord_destination} [<user.text>]:
Expand All @@ -18,7 +34,9 @@ current call: user.discord_go_current_call()
toggle pins: user.discord_toggle_pins()
toggle inbox: user.discord_toggle_inbox()
toggle (members | member list): user.discord_toggle_members()
toggle (vee see text | voice text): user.discord_toggle_members()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tried this with v c text instead? This usually works fine with conformer and is a bit more intention revealing.

toggle (dee ems | dims): user.discord_toggle_dms()
toggle sound board: user.discord_toggle_soundboard()
pick emoji: user.discord_emoji_picker()
pick (jif | gif | gift): user.discord_gif_picker()
pick sticker: user.discord_sticker_picker()
Expand All @@ -32,3 +50,8 @@ mark inbox channel read: user.discord_mark_inbox_read()
[toggle] (deafen | undeafen): user.discord_deafen()
answer call: user.discord_answer_call()
decline call: user.discord_decline_call()
start call: user.discord_start_call()
(create | join) server: user.discord_create_join_server()
create private group: user.discord_create_private_group()
open support: user.discord_open_support()
start low fie: user.discord_start_lofi()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the community backlog session — I realize we do not have a lot of consistency here (issue on this is incoming) already but with new voice commands we tend to prefer a noun verb syntax.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you guys have a standard method of deprecating commands? If so, I could deprecate the prior syntax and convert to the new syntax.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup! See core/deprecations.py and BREAKING_CHANGES.txt.

21 changes: 21 additions & 0 deletions apps/discord/discord_mac.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,29 @@ def discord_answer_call():
def discord_decline_call():
actions.key("esc")

def discord_start_call():
actions.key("ctrl-'")

def discord_go_current_call():
actions.key("cmd-alt-a")

def discord_toggle_dms():
actions.key("cmd-alt-right")

def discord_create_join_server():
actions.key("cmd-shift-n")

def discord_toggle_soundboard():
actions.key("cmd-shift-b")

def discord_create_private_group():
actions.key("cmd-shift-t")

def discord_channel_oldest_unread():
actions.key("shift-pageup")

def discord_open_support():
actions.key("cmd-shift-h")

def discord_start_lofi():
actions.key("cmd-alt-shift-w")
21 changes: 21 additions & 0 deletions apps/discord/discord_win.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,29 @@ def discord_answer_call():
def discord_decline_call():
actions.key("esc")

def discord_start_call():
actions.key("ctrl-'")

def discord_go_current_call():
actions.key("ctrl-shift-alt-v")

def discord_toggle_dms():
actions.key("ctrl-alt-right")

def discord_create_join_server():
actions.key("ctrl-shift-n")

def discord_toggle_soundboard():
actions.key("ctrl-shift-b")

def discord_create_private_group():
actions.key("ctrl-shift-t")

def discord_channel_oldest_unread():
actions.key("shift-pageup")

def discord_open_support():
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if this should be a more general command to open help rather than something discord specific.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I'm for it being a general command. However, I'm unsure as to what a clean syntax for that would look like. Help is already taken. It could be app help maybe?

Is there a standard way of handling common functionalities between applications that need to be differentiated from talon ones?

Copy link
Collaborator

@nriley nriley May 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, you could consider defining a tag for it, or (probably better in this case) implementing it for an entire platform at a time via an action.

app help sounds good to me too; there's a similar feature for settings/preferences going in with #1841.

actions.key("ctrl-shift-h")

def discord_start_lofi():
actions.key("ctrl-alt-shift-w")