I'd like to combine GCP Cloud Scheduler and Cloud Functions to send a message to a Discord Channel every week.
Ideally the Scheduler will use a HTTP trigger and the Cloud Function will then run, sending the message to the specific channel.
main.py:
import discord
def bot_function():
client = discord.Client()
channel_id = "CHANNEL_ID"
@client.event
async def on_ready():
await client.get_channel(channel_id).send("TEST MESSAGE")
client.run("API_KEY")
I've included discord in requirements.text, however, I'm getting the following errors when I test the function: error messages:
- RuntimeError: There is no current event loop in thread 'ThreadPoolExecutor-0_0'.,
- RuntimeError: set_wakeup_fd only works in main thread
- TypeError: bot_function() takes 0 positional arguments but 1 was given
