scheduled fuck up

This commit is contained in:
aliasless 2020-04-11 07:08:53 +00:00
parent 21dff32fcb
commit 9ead236289
1 changed files with 14 additions and 1 deletions

View File

@ -10,6 +10,7 @@ import os.path
ROOT = "/home/bot/ticker"
SEGUIS = 665399296522321942
GOONS = 499822662281854996
MATT = 150791815723876352
client = discord.Client()
@ -58,7 +59,7 @@ async def ticker_update():
# we are not already in the correct channel
if not target_voice_channel.id == voice_client.channel.id:
await voice_client.move_to(target_voice_channel.id)
await voice_client.move_to(target_voice_channel)
# load and play supplied message
source = discord.FFmpegOpusAudio(announce_file)
@ -91,6 +92,10 @@ async def on_voice_state_update(member, before, after):
async def on_member_update(before, after):
# try to get the name of the before activity
before_name = None
# literally any of these fields might not exist and python has no safe navigation
# nor does it have pattern matching usable for this purpose
# guess i'll die
if before and before.activity and before.activity.type == discord.ActivityType.playing and before.activity.name:
before_name = before.activity.name
@ -117,16 +122,24 @@ async def add_event(file_name, voice_channel):
await ticker_queue.put((file_name, voice_channel))
async def ticker():
voice_channel = get_best_channel(SEGUIS)
file_name = to_tts("The current JPY exchange rate is " + str(c.get_rate('USD', 'JPY')) + " yen to a dollar")
await add_event(file_name, voice_channel)
async def flatten():
voice_channel = get_best_channel(SEGUIS)
file_name = to_tts("Matt, it is time for your 4 PM dick flattening")
await add_event(file_name, voice_channel)
async def cummies():
voice_channel = get_best_channel(GOONS)
file_name = to_tts("cum drip pussy slit")
await add_event(file_name, voice_channel)
s = AsyncIOScheduler(event_loop = client.loop)
s.add_job(ticker, CronTrigger(hour = '0-19,21-23'))
s.add_job(flatten, CronTrigger(hour = '20'))
s.add_job(cummies, CronTrigger(hour = '*', minute = '30'))
s.start()
with open(ROOT + "/priv/token") as file: