コード例 #1
0
 async def state_size(self, ctx, subject: discord.Member, new_value: int):
     """Changes the state size. Default value is 3. Smaller values tend to generate more chaotic sentences."""
     old_value, newline = db_queries.get_markov_settings(
         self.session, ctx, subject)
     db_queries.update_markov_settings(self.session, ctx, subject,
                                       new_value, newline)
     await ctx.send(
         f'Markovify state size changed from {old_value} to {new_value} for {subject.name}'
     )
コード例 #2
0
 async def off(self, ctx, *, subject: discord.Member):
     if subject:
         state_size, _ = db_queries.get_markov_settings(
             self.session, ctx, subject)
         db_queries.update_markov_settings(self.session, ctx, subject,
                                           state_size, False)
         await ctx.send(f'markovify newline off for user {subject.name}')
     else:
         await ctx.send('Usage: `df!markovify newline off <User#0000>`')
コード例 #3
0
 async def state_size(self,
                      ctx,
                      subject: discord.Member = None,
                      new_value: int = None):
     """Changes the state size. Default value is 3. Smaller values tend to generate more chaotic sentences."""
     if subject and new_value:
         old_value, newline = db_queries.get_markov_settings(
             self.session, ctx, subject)
         db_queries.update_markov_settings(self.session, ctx, subject,
                                           new_value, newline)
         await ctx.send(
             f'Markovify state size changed from {old_value} to {new_value} for {subject.name}'
         )
     else:
         await ctx.send(
             'Usage: `df!markovify state_size <User#0000> <value>`')