"""Scheduler class""" import os from app import scheduler, DiscordClient def add_send_code(): """Send code to user""" job = scheduler.get_job("send_code") print("hi") if job is None: job = scheduler.add_job( id="send_code", func=run_send_code, trigger="date", ) def run_send_code(): """Upgrade to new version""" discord_client = DiscordClient() discord_client.run(os.environ["DISCORD_TOKEN"]) discord_channel = client.get_channel(373000514608300034) discord_channel.send('hello') if __name__ == "__main__": run_send_code.__module__ = "scheduler"