Spaces:
Runtime error
Runtime error
Update discord_bot.py
Browse files- 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.
|
| 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.
|
| 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)
|