mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-07 11:48:55 -05:00
parent
4a77e764a6
commit
77d3b9b5e5
@ -524,9 +524,13 @@ class Streams:
|
|||||||
def enable_or_disable_if_active(self, streams, stream, channel, _id=None):
|
def enable_or_disable_if_active(self, streams, stream, channel, _id=None):
|
||||||
"""Returns True if enabled or False if disabled"""
|
"""Returns True if enabled or False if disabled"""
|
||||||
for i, s in enumerate(streams):
|
for i, s in enumerate(streams):
|
||||||
|
stream_id = s.get("ID")
|
||||||
|
if stream_id and _id: # ID is available, matching by ID is
|
||||||
|
if stream_id != _id: # preferable
|
||||||
|
continue
|
||||||
|
else: # ID unavailable, matching by name
|
||||||
if s["NAME"] != stream:
|
if s["NAME"] != stream:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if channel.id in s["CHANNELS"]:
|
if channel.id in s["CHANNELS"]:
|
||||||
streams[i]["CHANNELS"].remove(channel.id)
|
streams[i]["CHANNELS"].remove(channel.id)
|
||||||
if not s["CHANNELS"]:
|
if not s["CHANNELS"]:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user