【发布时间】:2021-04-19 15:47:40
【问题描述】:
这是代码的开始。我是否在代码中输入了错误,导致命令不起作用?
import discord
import os
from keep_alive import keep_alive
from discord.ext import commands
import random
client = commands.Bot(command_prefix= '>')
@client.event
async def on_ready():
print('The bot is online')
await client.change_presence(
activity=discord.Game('>help ┃ Created by ColeTMK'))
@client.command()
@commands.has_permissions(manage_messages=True)
async def clear(ctx, amount=6):
await ctx.channel.purge(limit=amount)
【问题讨论】:
-
嗨,你在哪里找到“keep_alive”python 模块?
-
@IODEV 我相信 OP 正在使用 repl.it 在 repl 上,不可能 24/7 运行,因此制作了一个 keep_alive 脚本。它实现了 uptimerobot 和烧瓶。如果你愿意,你可以问这个问题。或者,快速 repl 搜索也可以。