diff --git a/apps/discord/discord.py b/apps/discord/discord.py index d7f88707bb..2d934acb87 100644 --- a/apps/discord/discord.py +++ b/apps/discord/discord.py @@ -1,4 +1,4 @@ -from talon import Module +from talon import Context, Module mod = Module() apps = mod.apps @@ -9,6 +9,20 @@ browser.host: discord.com """ +mod.list("discord_destination", desc="discord destination") + +ctx = Context() +ctx.matches = r""" +app: discord +""" + +ctx.lists["user.discord_destination"] = { + "user": "@", + "channel": "#", + "voice": "!", + "server": "*", +} + @mod.action_class class discord_actions: @@ -50,3 +64,12 @@ def discord_answer_call(): def discord_decline_call(): """Decline incoming call""" + + def discord_quick_switcher(dest_type: str, dest_search: str): + """Open up the quick switcher, optionally specifying a type of destination""" + + def discord_go_current_call(): + """Go to current call""" + + def discord_toggle_dms(): + """Toggle between dms and your most recent server""" diff --git a/apps/discord/discord.talon b/apps/discord/discord.talon index 20aded2dda..416654301f 100644 --- a/apps/discord/discord.talon +++ b/apps/discord/discord.talon @@ -7,6 +7,11 @@ tag(): user.emoji [channel] mentions last: user.discord_mentions_last() [channel] mentions next: user.discord_mentions_next() oldest unread: user.discord_oldest_unread() +{user.discord_destination} []: + user.discord_quick_switcher(user.discord_destination, user.text or "") +switcher: user.discord_quick_switcher("", "") +current call: user.discord_go_current_call() +toggle (dee ems | dims): user.discord_toggle_dms() # UI toggle pins: user.discord_toggle_pins() @@ -18,6 +23,9 @@ pick (jif | gif | gift): user.discord_gif_picker() # Misc mark inbox channel read: user.discord_mark_inbox_read() [toggle] (mute | unmute): user.discord_mute() +(mute | unmute) and sleep: + user.discord_mute() + speech.disable() [toggle] (deafen | undeafen): user.discord_deafen() answer call: user.discord_answer_call() decline call: user.discord_decline_call() diff --git a/apps/discord/discord_win.py b/apps/discord/discord_win.py index 258b42ae35..a930e0dc9b 100644 --- a/apps/discord/discord_win.py +++ b/apps/discord/discord_win.py @@ -40,7 +40,7 @@ def discord_mentions_next(): actions.key("ctrl-alt-shift-down") def discord_oldest_unread(): - actions.key("shift-paegup") + actions.key("shift-pageup") # UI def discord_toggle_pins(): @@ -82,3 +82,15 @@ def discord_answer_call(): def discord_decline_call(): actions.key("esc") + + def discord_go_current_call(): + actions.key("ctrl-shift-alt-v") + + def discord_toggle_dms(): + actions.key("ctrl-alt-right") + + def discord_quick_switcher(dest_type: str, dest_search: str): + actions.key("ctrl-k") + actions.insert(dest_type) + if dest_search: + actions.insert(dest_search)