matrix-music-bot

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 4c42df81816cb81ae2896a26ad5f26c9c85290e0
parent 43ee88a8c1f016959415f7ab7b3227b88f6110eb
Author: John <mail@johnkubach.com>
Date:   Wed, 19 Oct 2022 19:56:04 -0400

Only Fire If Message Starts With URL

Diffstat:
Mmusic.py | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/music.py b/music.py @@ -65,7 +65,7 @@ def send_message(room, message): def on_message(room, event): if event['type'] == 'm.room.message': if event['content']['msgtype'] == "m.text": - if 'youtube.com' in event['content']['body'] or 'youtu.be' in event['content']['body']: + if event['content']['body'].startswith('https://youtu') or event['content']['body'].startswith('https://www.youtu'): message = youtube(event) send_message(room, message)