Funguy Plugin Enable/Disable feature per room, save to conf file

This commit is contained in:
2024-03-03 15:01:44 -07:00
parent 5d6ad98303
commit 41c59618cc
3 changed files with 69 additions and 6 deletions

View File

@@ -32,7 +32,7 @@ async def fetch_youtube_info(youtube_url):
async def handle_command(room, message, bot, prefix, config):
match = botlib.MessageMatch(room, message, bot, prefix)
if match.is_not_from_this_bot() and re.search(r'youtube\.com/watch\?v=', message.body) and room.room_id != '!uFhErnfpYhhlauJsNK:matrix.org':
if match.is_not_from_this_bot() and re.search(r'youtube\.com/watch\?v=', message.body): # and room.room_id != '!uFhErnfpYhhlauJsNK:matrix.org':
logging.info("YouTube link detected")
video_id_match = re.search(r'youtube\.com/watch\?v=([^\s]+)', message.body)
if video_id_match: