下面是我的代码
import discord
from discord.ext import commands
client = commands.Bot(command_prefix = "!")
swingsMessage = "Update me"
@client.command()
async def swings(ctx):
await ctx.send(swingsMessage)
@client.command()
async def update(ctx,*,message):
if str(ctx.message.author) == "buysellshort#9420":
global swingsMessage
swingsMessage = message
用户类型!更新并在一行中显示一条消息,当用户键入时,bot将读取该消息!它将显示该消息。现在它可以工作了,运行正常,但第二天它又回到了“更新我”,它在Heroku上托管,是一个dyno机器人
有什么建议吗?是代码错了,还是你们认为它所在的linux机器刚刚关闭,这就是它被重置的原因
在Procfile上,可以用
worker
代替web
。这将摆脱30分钟的不活动状态,但要小心,因为它将全天候工作,并且可以很快消耗你的时间看起来它在没有收到任何流量的30分钟超时后休眠
Source
相关问题 更多 >
编程相关推荐