Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

122 Zeilen
3.5KB

  1. import discord
  2. import random
  3. from discord.ext.commands import bot
  4. class Fun():
  5. def __init__(self, Bot):
  6. self.bot = Bot
  7. @bot.command(pass_context=True)
  8. async def roll(self, ctx, die):
  9. """
  10. Rolls a die using ndx format.
  11. Usage:
  12. {command_prefix}roll ndx
  13. Example:
  14. .roll 2d20 # Rolls two D20s
  15. """
  16. # TODO: Change to ndx format
  17. dice = 0
  18. if die[0].isdigit():
  19. if die[1].isdigit() or die[0] == 0:
  20. return await self.bot.say("I only support multipliers from 1-9")
  21. multiplier = int(die[0])
  22. else:
  23. multiplier = 1
  24. if die[1].lower() != "d" and die[0].lower() != "d":
  25. return await self.bot.say("Use the format 'ndx'.")
  26. options = (4, 6, 8, 10, 12, 20, 100)
  27. for option in options:
  28. if die.endswith(str(option)):
  29. dice = option
  30. if dice == 0:
  31. return await self.bot.say("You didn't give a die to use.")
  32. rolls = []
  33. if dice == 100:
  34. step = 10
  35. else:
  36. step = 1
  37. total = 0
  38. if multiplier > 1:
  39. for x in range(multiplier):
  40. rolls.append(random.randrange(step, dice+1, step))
  41. for r in rolls:
  42. total += r
  43. return await self.bot.say("{} rolled **{}**. Totaling **{}**".format(ctx.message.author.mention, rolls, total))
  44. else:
  45. roll = random.randrange(step, dice + 1, step)
  46. return await self.bot.say("{} rolled a **{}**".format(ctx.message.author.mention, roll))
  47. @bot.command(pass_context=True)
  48. async def spank(self, ctx, *, user: discord.User = None):
  49. """
  50. Spanks the mentioned user ;)
  51. Usage:
  52. {command_prefix}spank @RoxBot#4170
  53. {command_prefix}spank RoxBot
  54. """
  55. if not user:
  56. return await self.bot.say("You didn't mention someone for me to spank")
  57. return await self.bot.say(":peach: :wave: *{} spanks {}*".format(self.bot.user.name, user.name))
  58. @bot.command(pass_context=True)
  59. async def suck(self, ctx, *, user: discord.User = None):
  60. """
  61. Sucks the mentioned user ;)
  62. Usage:
  63. {command_prefix}suck @RoxBot#4170
  64. {command_prefix}suck RoxBot
  65. """
  66. if not user:
  67. return await self.bot.say("You didn't mention someone for me to suck")
  68. return await self.bot.say(":eggplant: :sweat_drops: :tongue: *{} sucks {}*".format(self.bot.user.name, user.name))
  69. @bot.command(pass_context=True, aliases=["wf"])
  70. async def waifurate(self, ctx):
  71. """
  72. Rates the mentioned waifu(s)
  73. Usage:
  74. {command_prefix}waifurate @user#9999
  75. """
  76. mentions = ctx.message.mentions
  77. if not mentions:
  78. return await self.bot.reply("You didn't mention anyone for me to rate.", delete_after=10)
  79. rating = random.randrange(1, 11)
  80. if rating <= 2:
  81. emoji = ":sob:"
  82. elif rating <= 4:
  83. emoji = ":disappointed:"
  84. elif rating <= 6:
  85. emoji = ":thinking:"
  86. elif rating <= 8:
  87. emoji = ":blush:"
  88. elif rating == 9:
  89. emoji = ":kissing_heart:"
  90. else:
  91. emoji = ":heart_eyes:"
  92. if len(mentions) > 1:
  93. return await self.bot.say("Oh poly waifu rating? :smirk: Your combined waifu rating is {}/10. {}".format(rating, emoji))
  94. else:
  95. return await self.bot.say("Oh that's your waifu? I rate them a {}/10. {}".format(rating, emoji))
  96. @bot.command(pass_context=True, aliases=["cf"])
  97. async def coinflip(self, ctx):
  98. """Flip a coin"""
  99. return await self.bot.reply("the coin landed on {}!".format(random.choice(["heads", "tails"])))
  100. @bot.command(pass_context=True)
  101. async def aesthetics(self, ctx, *convert):
  102. """Converts text to be more a e s t h e t i c s"""
  103. WIDE_MAP = dict((i, i + 0xFEE0) for i in range(0x21, 0x7F))
  104. WIDE_MAP[0x20] = 0x3000
  105. convert = str(' '.join(convert)).translate(WIDE_MAP)
  106. return await self.bot.say(convert)
  107. def setup(Bot):
  108. Bot.add_cog(Fun(Bot))