It says "x" is not accessed Pylance But I don't know why it used to work until now. If you can please help.
troll3= ["troll" , "ulikemen" , "someone-is-in-my-house" , ";/","amogsus"]
@client.command()
@commands.has_permissions(administrator=True)
async def nuke(ctx):
guild = ctx.guild
await ctx.author.send(f'fake nuke command lol {ctx.author.mention}')
for x in range(5):
time.sleep(1)
await ctx.send(f'[+] role: {(random.choice(troll3))} has been created')
try:
for channel in guild.channels:
await ctx.send(f'channel: {channel.name} was deleted')
except:
await ctx.send('g')
I have fixed the error by changing X to _ which has made the code work properly.
troll3= ["troll" , "ulikemen" , "someone-is-in-my-house" , ";/","amogsus"]
@client.command()
@commands.has_permissions(administrator=True)
async def nuke(ctx):
guild = ctx.guild
await ctx.author.send(f'fake nuke command lol {ctx.author.mention}')
for _ in range(5): # This has been solved. I switched x to _ and it works now.
time.sleep(1)
await ctx.send(f'[+] role: {(random.choice(troll3))} has been created')
try:
for channel in guild.channels:
await ctx.send(f'channel: {channel.name} was deleted')
except:
await ctx.send('g')