summaryrefslogtreecommitdiffstats
path: root/notcqst.py
diff options
context:
space:
mode:
authorcqst <cqst@cqstia.com>2025-08-22 14:42:24 -0700
committercqst <cqst@cqstia.com>2025-08-22 14:42:24 -0700
commit0b9034173617b8071ff36a9a01b6bee81c50755c (patch)
tree409167642610d70f7254a1e8938455f23891f8b1 /notcqst.py
parent579208925b0f4e55ab00d6b44cdf14cd300045af (diff)
working choice and youtube
Diffstat (limited to 'notcqst.py')
-rw-r--r--notcqst.py36
1 files changed, 29 insertions, 7 deletions
diff --git a/notcqst.py b/notcqst.py
index 40f04b3..b5cc1b7 100644
--- a/notcqst.py
+++ b/notcqst.py
@@ -1,6 +1,8 @@
import socket
+import random
from yt_dlp import YoutubeDL
+
def check_youtube():
if "https://youtube.com" in text_str or "https://www.youtube.com" in text_str:
split_str = text_str.split('##tech-tangents :')
@@ -16,16 +18,36 @@ def check_youtube():
else:
return 0
-
-def command_choose():
-
+
+def command_choose(split_spaces):
+ print(split_spaces)
+ arr_hack = len(split_spaces)
+ arr_hack -= 2
+ choices = []
+ for x in range(arr_hack):
+ choices.append(split_spaces[x+2])
+ print(choices)
+ decision = random.choice(choices)
+ irc.send((bytes("PRIVMSG " + channel + " :" + decision + "\r\n", 'utf-8')))
+
+
+def command_hello():
+ irc.send((bytes("PRIVMSG " + channel + " :" + "Hello, " + "\r\n", 'utf-8')))
+
+
+def unknown_command():
+ irc.send((bytes("PRIVMSG " + channel + " :" + "Sorry I don't understand." + "\r\n", 'utf-8')))
+
def command_flag():
- if "n!" in text_str:
- split_text = text.split(':n!')
- command = split_text[1].strip()
+ if ":n!" in text_str:
+ split_text = text_str.split(':n!')
+ split_spaces = split_text[1].split(' ')
+ command = split_spaces[1].strip()
match command:
- case "choose": command_choose()
+ case "choose": command_choose(split_spaces)
+ case "hello": command_hello()
+ case _: unknown_command()
def parse_cmd():