joytou commited on
Commit
6ac2b5f
1 Parent(s): 7073b9f

Update discord_bot.py

Browse files
Files changed (1) hide show
  1. discord_bot.py +2 -2
discord_bot.py CHANGED
@@ -38,7 +38,7 @@ async def on_message(message):
38
  await message.channel.send('Hello!')
39
 
40
  async def sendMessageToChannelHelper(data):
41
- channel = await bot.fetch_channel(os.getenv("CHANNEL_ID"))
42
  # 创建一个 embed 对象
43
  mTitle = "Empty Title"
44
  if "id" in data:
@@ -68,7 +68,7 @@ def sendMessageToChannel(data):
68
 
69
  def run():
70
  try:
71
- token = os.getenv("TOKEN") or ""
72
  if token == "":
73
  raise Exception("Please add your token to the Secrets pane.")
74
  bot.run(token)
 
38
  await message.channel.send('Hello!')
39
 
40
  async def sendMessageToChannelHelper(data):
41
+ channel = await bot.fetch_channel(os.environ.get("CHANNEL_ID"))
42
  # 创建一个 embed 对象
43
  mTitle = "Empty Title"
44
  if "id" in data:
 
68
 
69
  def run():
70
  try:
71
+ token = os.environ.get("TOKEN") or ""
72
  if token == "":
73
  raise Exception("Please add your token to the Secrets pane.")
74
  bot.run(token)