import discord
from discord.ext.commands import Bot
from discord.ext import commands
import asyncio
import time
import random
from PIL import Image
Client = discord.Client()
client = commands.Bot(command_prefix = "-")`
@client.command
async def spam(ctx, arg):
count = 0
await Context.send(message.channel, "Wait for it....")
time.sleep(3)
while count < 20:
await ctx.send(arg)
time.sleep(3)
count = count + 1
This code is supposed to mention the person specified in the argument. For example if someone typed -spam @Bob the bot should say
@Bob
@Bob 20 times
client.run('token')which would start the bot. Also, you haven't definedContextyet you use it. Perhaps this should bectx? Which version ofdiscord.pyare you using?