scheduled fuck up
This commit is contained in:
parent
21dff32fcb
commit
9ead236289
15
ticker.py
15
ticker.py
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue