Advertisement
Wonkiest29

Untitled

Oct 9th, 2023
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.62 KB | None | 0 0
  1. import disnake
  2. from disnake.ext import commands
  3. import embedManager as embeds
  4. import aiohttp
  5. class UtilityCog(commands.Cog):
  6. """actions, 18+"""
  7.  
  8. def __init__(self, bot: commands.Bot):
  9. self.bot = bot
  10.  
  11. @commands.slash_command()
  12. async def actions(inter):
  13. # Here you can paste some code, it will run for every invoked sub-command.
  14. pass
  15.  
  16.  
  17. # Ping command
  18. @actions.sub_command(name="waifu",description="Get the bots latency.")
  19. @commands.cooldown(rate= 1, per= 10, type= commands.BucketType.member)
  20. async def waifu(self, inter: disnake.ApplicationCommandInteraction):
  21. async with aiohttp.ClientSession() as session:
  22. async with session.get('https://api.waifu.pics/sfw/waifu') as response:
  23. response.raise_for_status() # Raise an exception if the request was not successful
  24. data = await response.json()
  25. image_url = data['url']
  26. await inter.response.send_message(image_url)
  27.  
  28. @actions.sub_command(name="kiss",description="Get the bots latency.")
  29. @commands.cooldown(rate= 1, per= 10, type= commands.BucketType.member)
  30. async def kiss(self, inter: disnake.ApplicationCommandInteraction):
  31. """Get the bot's current websocket latency."""
  32. await inter.response.send_message(embed=embeds.createEmbed(f"πŸ“ Pong!",f"Latency is {round(self.bot.latency * 1000)}ms"))
  33.  
  34. @actions.sub_command(name="love",description="pics 18+")
  35. @commands.is_nsfw()
  36. @commands.cooldown(rate= 1, per= 10, type= commands.BucketType.member)
  37. async def love(self, inter: disnake.ApplicationCommandInteraction):
  38. """Get the bot's current websocket latency."""
  39. await inter.response.send_message(embed=embeds.createEmbed(f"πŸ“ Pong!",f"Latency is {round(self.bot.latency * 1000)}ms"))
  40.  
  41.  
  42. async def love_error(ctx, error):
  43. if isinstance(error, commands.NSFWChannelRequired):
  44. await ctx.respond(embed=embeds.createErrorEmbed(f"This command can only be used in NSFW channels."), ephemeral=True)
  45. else:
  46. raise error
  47.  
  48. @actions.sub_command(name="pat",description="Get the bots latency.")
  49. @commands.cooldown(rate= 1, per= 10, type= commands.BucketType.member)
  50. async def pat(self, inter: disnake.ApplicationCommandInteraction):
  51. """Get the bot's current websocket latency."""
  52. await inter.response.send_message(embed=embeds.createEmbed(f"πŸ“ Pong!",f"Latency is {round(self.bot.latency * 1000)}ms"))
  53.  
  54. @actions.sub_command(name="bite",description="Get the bots latency.")
  55. @commands.cooldown(rate= 1, per= 10, type= commands.BucketType.member)
  56. async def bite(self, inter: disnake.ApplicationCommandInteraction):
  57. """Get the bot's current websocket latency."""
  58. await inter.response.send_message(embed=embeds.createEmbed(f"πŸ“ Pong!",f"Latency is {round(self.bot.latency * 1000)}ms"))
  59.  
  60. @actions.sub_command(name="kill",description="Get the bots latency.")
  61. @commands.cooldown(rate= 1, per= 10, type= commands.BucketType.member)
  62. async def kill(self, inter: disnake.ApplicationCommandInteraction):
  63. """Get the bot's current websocket latency."""
  64. await inter.response.send_message(embed=embeds.createEmbed(f"πŸ“ Pong!",f"Latency is {round(self.bot.latency * 1000)}ms"))
  65.  
  66. @actions.sub_command(name="lick",description="Get the bots latency.")
  67. @commands.cooldown(rate= 1, per= 10, type= commands.BucketType.member)
  68. async def lick(self, inter: disnake.ApplicationCommandInteraction):
  69. """Get the bot's current websocket latency."""
  70. await inter.response.send_message(embed=embeds.createEmbed(f"πŸ“ Pong!",f"Latency is {round(self.bot.latency * 1000)}ms"))
  71.  
  72. @actions.sub_command(name="hug",description="Get the bots latency.")
  73. @commands.cooldown(rate= 1, per= 10, type= commands.BucketType.member)
  74. async def hug(self, inter: disnake.ApplicationCommandInteraction):
  75. """Get the bot's current websocket latency."""
  76. await inter.response.send_message(embed=embeds.createEmbed(f"πŸ“ Pong!",f"Latency is {round(self.bot.latency * 1000)}ms"))
  77.  
  78. @actions.sub_command(name="nom",description="Get the bots latency.")
  79. @commands.cooldown(rate= 1, per= 10, type= commands.BucketType.member)
  80. async def nom(self, inter: disnake.ApplicationCommandInteraction):
  81. """Get the bot's current websocket latency."""
  82. await inter.response.send_message(embed=embeds.createEmbed(f"πŸ“ Pong!",f"Latency is {round(self.bot.latency * 1000)}ms"))
  83.  
  84. def setup(bot: commands.Bot):
  85. bot.add_cog(UtilityCog(bot))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement