File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import discord
22from discord .ext import commands
33
4+ from arthur .apis .netcup .ssh import rce_as_a_service
45from arthur .config import CONFIG
56
67
@@ -58,9 +59,25 @@ async def numbers(
5859 vc .play (discord .FFmpegOpusAudio (CONFIG .numbers_url ))
5960 await ctx .message .add_reaction ("🔊" )
6061
62+ @numbers .command ()
63+ async def tts (self , ctx : commands .Context , * , text : str ) -> None :
64+ """Have KA read out a message in the current VC."""
65+ if not ctx .guild or not ctx .guild .voice_client :
66+ return
67+
68+ if not ctx .bot .is_owner (ctx .author ):
69+ await ctx .message .add_reaction ("❌" )
70+ return
71+
72+ await rce_as_a_service (
73+ f"echo '{ text } ' > /opt/messages/tts_message.txt && "
74+ "touch -a -m -t 197501010001 /opt/messages/tts_message.txt && "
75+ "sudo /opt/numbers-code-generator.sh"
76+ )
77+
6178 @numbers .command ()
6279 async def stop (self , ctx : commands .Context ) -> None :
63- """Stop playing URN in the servers voice channel."""
80+ """Stop relaying numbers in the voice channel."""
6481 if ctx .guild and (vc := ctx .guild .voice_client ):
6582 await vc .disconnect (force = True )
6683 await ctx .message .add_reaction ("🔇" )
You can’t perform that action at this time.
0 commit comments