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")
from threading import Thread
import discord
from discord.ext import commands
bot = commands.Bot(command_prefix='!')
@bot.command(pass_context=True)
async def f(ctx):
for i in range(3):
await ctx.send('Test2')
@bot.command(pass_context=True)
async def f_2(ctx):
for i in range(3):
await ctx.send('Test')
@bot.command(pass_context=True)
async def test1(ctx):
bot.loop.create_task(f(ctx))
bot.loop.create_task(f_2(ctx))
bot.run()