示例#1
0
 async def get_quote(ctx, id, user_id):
     quote = QuoteEnum.get_by_id(id)
     if quote == QuoteEnum.RANDOM:
         return await QuoteEnum.get_random_quote_from_history(
             ctx.guild.text_channels, user_id)
     elif quote.value.file:
         return FileUtils.get_file(quote.value.quote)
     else:
         return quote.value
示例#2
0
 async def grammar(self, ctx):
     text = ctx.content
     if not GrammarEnum.is_less(text):
         await self.giannakis_grammar(ctx)
         return
     matches = self.language_tool.check(text)
     for match in matches:
         if match.ruleId == GrammarEnum.FEWER_LESS.value.value:
             self.logging_service.log("Sending 'fewer' gif")
             file = FileUtils.get_file(FileUtils.FEWER_GIF)
             await ctx.reply(f'"{match.sentence}"', file=file)
示例#3
0
 async def omega_bonk(self, ctx: commands.context):
     self.logging_service.log_starting_process(
         CommandsEnum.OMEGA_BONK.value)
     if not self.is_allowed_to_use_command(ctx.author.id,
                                           CommandsEnum.OMEGA_BONK):
         return
     index = randint(0, 1)
     emoji = await self.get_custom_emoji(ctx, EmojiEnum.BONK.value)
     if index == 0:
         message = self.art_service.get_omega_bonk()
         await self.send_message_with_reaction(ctx, message, emoji)
     else:
         file = FileUtils.get_file(FileUtils.FANCY_BONK_GIF)
         await self.send_file_with_reaction(ctx, file, emoji)
示例#4
0
 def get_response(id):
     response = JudgeBonkoResponseEnum.get_by_id(id).value
     if response.file:
         return FileUtils.get_file(response.value)
     return response.value
示例#5
0
 def get_file(self, path):
     return FileUtils.get_file(path)