import discord
import time
from discord.ext import commands
from random import choice, randint
import cogs.utils
import asyncio
from cogs.utils import checks

class disco:
    """Changes a role's color every x seconds. Must be 60 or superior. Based off MasterKnight's cog"""

    def __init__(self, bot):
        self.bot = bot

	
    stopped = false
	
    @checks.admin_or_permissions(manage_roles=True)
    @commands.command(pass_context = True, no_pm=True)
    async def disco(self, ctx, seconds:float, *, role):
        """Changes a role's color every x seconds. Must be 60 or superior."""
        roleObj = discord.utils.find(lambda r: r.name == role, ctx.message.server.roles)
	
        if not roleObj:
            no = discord.Embed(title="{} is not a valid role".format(role))
            await self.bot.say(embed=no)
            return

        if interval < 60:
            await self.bot.say("The interval must be higher than 60.")
	    return
	
	await self.bot.say("{} is now disco!".format(role))
	
        while not stopped:
            colour = ''.join([choice('0123456789ABCDEF') for x in range(6)])
            colour = int(colour, 16)
            await self.bot.edit_role(ctx.message.server, roleObj, colour=discord.Colour(value=colour))
            await asyncio.sleep(interval)

    @checks.admin_or_permissions(manage_roles=True)
    @commands.command(pass_context = True, no_pm=True)
    async def stopdisco(self, ctx, *, role):
        """Stops the disco. Not sure if it works"""
	
        stopped = true
	
	
def setup(bot):
    n = disco(bot)
    bot.add_cog(n)

@@ -326,31 +326,43 @@
 ot%0A%0A
-%09%0A
     
-stopped = false%0A%09
+global stopped%0A    stopped = 0%0A
 %0A   
@@ -688,17 +688,37 @@
 .roles)%0A
-%09
+%0A        stopped = 0%0A
 %0A       
@@ -870,16 +870,17 @@
  return%0A
+ 
 %0A       
@@ -883,24 +883,23 @@
      if 
-interval
+seconds
  %3C 60:%0A 
@@ -968,17 +968,24 @@
 n 60.%22)%0A
-%09
+        
     retu
@@ -987,19 +987,25 @@
  return%0A
-%09%0A%09
+%0A        
 await se
@@ -1048,17 +1048,16 @@
 (role))%0A
-%09
 %0A       
@@ -1067,19 +1067,20 @@
 ile 
-not 
 stopped
+ == 0
 :%0A  
@@ -1326,24 +1326,23 @@
 o.sleep(
-interval
+seconds
 )%0A%0A    @
@@ -1503,50 +1503,60 @@
  %22%22%22
-Stops the disco. Not sure if it works
+DOESN'T DO ANYTHING!! DOESN'T WORK!! DON'T USE!!
 %22%22%22%0A
-%09
 %0A   
@@ -1574,16 +1574,76 @@
 d = 
-true%0A%09%0A%09
+1%0A        await self.bot.say(%22%7B%7D is no longer disco!%22.format(role))%0A
 %0Adef

Update disco.py