Voegt test voor review toe

This commit is contained in:
2022-12-04 20:40:30 +01:00
parent 47ae62afa9
commit e8df92be23
3 changed files with 38 additions and 8 deletions
+10 -8
View File
@@ -861,15 +861,8 @@ class Shitpost(commands.Cog):
except:
print("No permission to delete message")
yield from ctx.channel.send(message)
@commands.command(pass_context=True)
@asyncio.coroutine
def review(self, ctx, *args):
"""Stroop heeft (bijna) overal een mening over. Vraag het hem!
"""
topic = " ".join(args)
def get_review_string(self, topic = ""):
if topic == "":
random.seed(datetime.now())
else:
@@ -916,6 +909,15 @@ class Shitpost(commands.Cog):
emoj = random.choice(EMOJI)
message += str(rating) + " " + emoj*rating + " out of " + str(maxRating) + "."
return message
@commands.command(pass_context=True)
@asyncio.coroutine
def review(self, ctx, *args):
"""Stroop heeft (bijna) overal een mening over. Vraag het hem!
"""
topic = " ".join(args)
message = self.get_review_string(topic)
yield from ctx.channel.send(message)