【发布时间】:2020-08-19 21:30:18
【问题描述】:
from discord.ext import commands
import random
description = '''An example bot to showcase the discord.ext.commands extension
module.
There are a number of utility commands being showcased here.'''
bot = commands.Bot(command_prefix='?', description=description)
@bot.event
async def on_ready():
print('Logged in as')
print(bot.user.name)
print(bot.user.id)
print('------')
#here i need the help
@bot.command()
async def idea(ctx, content):
"""Repeats a message multiple times."""
await ctx.send(content)
f= open("supersmartidea.txt","a")
f.write("¦" + content + "\n")
机器人只保护作为 ctx 输入的第一个单词,所以如果我输入 ?想法这是个好主意, 只有“这个”被写下来。 机器人应该写下“这是个好主意” 我以前从未编写过机器人代码,也不知道如何修复它。
【问题讨论】: