title: How to send only 1 variable from a set of 3 in TinyDB
body: <p>[DISCORD.PY and TINYDB]</p>
  <p>I have set up a warning system for Discord. If someone gets warned, the data is saved like so:</p>
  <pre><code>{'userid': 264452325945376768, 'warnid': 37996302, 'reason': &quot;some reason&quot;}
  </code></pre>
  <p>Problem of this: I want the command &quot;!warnings&quot; to display these warnings, but I don't want it to have this ugly formatting of a JSON, instead I want it to display like so:</p>
  <pre><code>{member} has {amount} warnings.
  WARN-ID: {warning id here}
  REASON: {reason here}
  </code></pre>
  <p>To do this, I need to somehow call only one variable at a time instead of having all 3 (as of above JSON) instantly.</p>
  <p>My code is as follows:</p>
  <pre><code>@Ralf.command()
  async def warnings(ctx, *, member: discord.Member=None):
      if member is None:
          member = Ralf.get_user(ctx.author.id)
          member_id = ctx.author.id
      else:
          member = Ralf.get_user(member.id)
          member_id = member.id
      WarnList = Query()
      Result = warndb.search(WarnList.userid == member_id)
      warnAmt = len(Result)
      if warnAmt == 1:
          await ctx.send(f&quot;**{member}** has `{warnAmt}` warning.&quot;)
      else:
          await ctx.send(f&quot;**{member}** has `{warnAmt}` warnings.&quot;)
          for item in Result:
              await ctx.send(item)
  </code></pre>
  <p>This code is working, but it shows the ugly <code>{'userid': 264452325945376768, 'warnid': 37996302, 'reason': &quot;some reason&quot;}</code> as output.</p>
  <p>MAIN QUESTION: How do I call only userid without having warnid and reason displayed?</p>
  <p>EDIT 1:
  Trying to use dicts results in following:</p>
  <p>For that I get the following:</p>
  <pre><code>Ignoring exception in command warnings:
  Traceback (most recent call last):
    File &quot;C:\Users\entity2k3\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py&quot;, line 85, in wrapped
      ret = await coro(*args, **kwargs)
    File &quot;c:\Users\entity2k3\Desktop\Discord Bots All\Entity2k3's Moderation\main.py&quot;, line 201, in warnings
      await ctx.send(f&quot;WARN-ID: `{Result['warnid']}` REASON: {Result['reason']}&quot;)
  TypeError: list indices must be integers or slices, not str
  
  The above exception was the direct cause of the following exception:
  
  Traceback (most recent call last):
    File &quot;C:\Users\entity2k3\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py&quot;, line 903, in invoke
      await ctx.command.invoke(ctx)
    File &quot;C:\Users\entity2k3\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py&quot;, line 859, in invoke
      await injected(*ctx.args, **ctx.kwargs)
    File &quot;C:\Users\entity2k3\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py&quot;, line 94, in wrapped
      raise CommandInvokeError(exc) from exc
  discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: list indices must be integers or slices, not str
  </code></pre>