<gh_stars>0
from discord.ext import commands
import RankSystem, time, asyncio, random

class Misc(commands.Cog):
    def __init__(self, bot):
        self.bot = bot
  
    @commands.command(help="this command sends a gif")
    async def gif2(self, ctx):
        await ctx.send(f"https://media.giphy.com/media/xThta1UGIPPnJ5tm6I/giphy.gif")

    @commands.command(help = "this command sends you know what")
    async def sheesh(self, ctx):
        await ctx.send("SHEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEESH")



    @commands.command(help="sends the message Pong! and the time it took to do so")
    async def ping(self, ctx):
         """ Pong! """
         #await delete_message(ctx.message)
         before = time.monotonic()
         message = await ctx.send("Pong!")
         ping_time = (time.monotonic() - before) * 1000
         await message.edit(content=f"Pong!  `{int(ping_time)}ms`")
         print(f'Ping {int(ping_time)}ms')



    @commands.command(help="encode string with caesar cipher")
    async def caesar(self, ctx, *words: str):
        if words[-1].isdigit() or (words[-1].startswith('-') and words[-1][1:].isdigit()):
            msg = ' '.join(words[:-1])
            SHIFT = int(words[-1])
        else:
            msg = ' '.join(words)
            SHIFT = 13
        ciphered = ''.join([chr((ord(CHAR) + SHIFT - 97) % 26 + 97)\
            if CHAR.isalpha() and CHAR.islower()\
            else chr((ord(CHAR) + SHIFT - 65) % 26 + 65)\
            if CHAR.isalpha() and CHAR.isupper()\
            else CHAR for CHAR in msg])
        await ctx.send(f"{ciphered}")

   


    @commands.command(help="this command sends a gif")
    async def gif(self, ctx):
        await ctx.send(f"https://media.giphy.com/media/SggILpMXO7Xt6/giphy.gif")






    @commands.command(help="This command will display the current users rank and global rank")
    async def rank(self, ctx):
        await RankSystem.GetStatus(ctx.message)



    @commands.command(help="This command will display the top 10 users in the global or local scope. Options are 'local' or 'global'")
    async def lead(self, ctx):
        await RankSystem.GetTop10(self.bot, ctx.message)

  #DONT DELETE THIS -Ren


    @commands.Cog.listener()
    async def on_message(self, message):
        if not message.author.bot:
         await RankSystem.UpdateScore(message)

  #END OF RANK SYSTEM


def setup(bot):
  bot.add_cog(Misc(bot))

from discord.ext import commands
import RankSystem, time, asyncio, random

class Misc(commands.Cog):
    def __init__(self, bot):
        self.bot = bot
  
    @commands.command(help="this command sends a gif")
    async def gif2(self, ctx):
        await ctx.send(f"https://media.giphy.com/media/xThta1UGIPPnJ5tm6I/giphy.gif")

    @commands.command(help = "this command sends you know what")
    async def sheesh(self, ctx):
        await ctx.send("SHEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEESH")



    @commands.command(help="sends the message Pong! and the time it took to do so")
    async def ping(self, ctx):
         """ Pong! """
         #await delete_message(ctx.message)
         before = time.monotonic()
         message = await ctx.send("Pong!")
         ping_time = (time.monotonic() - before) * 1000
         await message.edit(content=f"Pong!  `{int(ping_time)}ms`")
         print(f'Ping {int(ping_time)}ms')



    @commands.command(help="encode string with caesar cipher")
    async def caesar(self, ctx, *words: str):
        if words[-1].isdigit() or (words[-1].startswith('-') and words[-1][1:].isdigit()):
            msg = ' '.join(words[:-1])
            SHIFT = int(words[-1])
        else:
            msg = ' '.join(words)
            SHIFT = 13
        ciphered = ''.join([chr((ord(CHAR) + SHIFT - 97) % 26 + 97)\
            if CHAR.isalpha() and CHAR.islower()\
            else chr((ord(CHAR) + SHIFT - 65) % 26 + 65)\
            if CHAR.isalpha() and CHAR.isupper()\
            else CHAR for CHAR in msg])
        await ctx.send(f"{ciphered}")

   


    @commands.command(help="this command sends a gif")
    async def gif(self, ctx):
        await ctx.send(f"https://media.giphy.com/media/SggILpMXO7Xt6/giphy.gif")






    @commands.command(help="This command will display the current users rank and global rank")
    async def rank(self, ctx):
        await RankSystem.GetStatus(ctx.message)



    @commands.command(help="This command will display the top 10 users in the global or local scope. Options are 'local' or 'global'")
    async def lead(self, ctx):
        await RankSystem.GetTop10(self.bot, ctx.message)

  #DONT DELETE THIS -Ren


    @commands.Cog.listener()
    async def on_message(self, message):
        if not message.author.bot:
         await RankSystem.UpdateScore(message)

  #END OF RANK SYSTEM


def setup(bot):
  bot.add_cog(Misc(bot))
Pong! #await delete_message(ctx.message) #DONT DELETE THIS -Ren #END OF RANK SYSTEM