import discord
from discord.ext import commands
client = commands.Bot(command_prefix='!')
cycles = dict(test1=True)
@client.command(pass_context=True)
async def stop(ctx):
cycles["test1"] = False
@client.command(pass_context=True)
async def test1(ctx):
while cycles["test1"]:
await ctx.send('Test')
client.run ("TOKEN")