-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
Hey there, i want to use an loop for that the script dont terminate.
Situation:
Streams goes online and script tells he is online but if they go offline i must restart the script.
And if he comes Online the script cant tell that he is online again.
custom function i made for clearing the streamingchannel in discord:
#variable section
intents = discord.Intents.all()
intents.members = True
intents.messages = True
intents.presences = True
client = discord.Client(intents=discord.Intents.all())
g = client.get_guild(xxx)
def channel_clear():
@client.event
async def on_ready():
global g
arr = [client.get_channel(xxx)]
for channel in arr:
print('Clearing messages...')
await channel.purge(limit=1000)
else:
print(channel, 'Keine Einträge gefunden')
config()
get_lock()
authorize()
main()
and this i tried
if discord_request.status_code == 204:
print("Successfully called Discord API. Waiting 5 seconds to terminate...")
time.sleep(5)
while discord_request.status_code == 204:
if len(twitch_json['data']) != 1:
print("nicht Online")
channel_clear()
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels