prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  [crash] bank balance  - when the bot doesnt have perms to send message
  ```Traceback (most recent call last):
    File "/home/bb8/venv/lib/python3.7/site-packages/discord/ext/commands/core.py", line 79, in wrapped
      ret = await coro(*args, **kwargs)
    File "/home/bb8/venv/lib/python3.7/site-packages/redbot/cogs/economy/economy.py", line 174, in balance
      user=user.display_name, num=humanize_number(bal), currency=currency
    File "/home/bb8/venv/lib/python3.7/site-packages/redbot/core/commands/context.py", line 81, in send
      return await super().send(content=content, **kwargs)
    File "/home/bb8/venv/lib/python3.7/site-packages/discord/abc.py", line 823, in send
      data = await state.http.send_message(channel.id, content, tts=tts, embed=embed, nonce=nonce)
    File "/home/bb8/venv/lib/python3.7/site-packages/discord/http.py", line 218, in request
      raise Forbidden(r, data)
  discord.errors.Forbidden: 403 FORBIDDEN (error code: 50013): Missing Permissions
  
  The above exception was the direct cause of the following exception:
  
  Traceback (most recent call last):
    File "/home/bb8/venv/lib/python3.7/site-packages/discord/ext/commands/bot.py", line 863, in invoke
      await ctx.command.invoke(ctx)
    File "/home/bb8/venv/lib/python3.7/site-packages/redbot/core/commands/commands.py", line 587, in invoke
      await super().invoke(ctx)
    File "/home/bb8/venv/lib/python3.7/site-packages/discord/ext/commands/core.py", line 1158, in invoke
      await ctx.invoked_subcommand.invoke(ctx)
    File "/home/bb8/venv/lib/python3.7/site-packages/discord/ext/commands/core.py", line 728, in invoke
      await injected(*ctx.args, **ctx.kwargs)
    File "/home/bb8/venv/lib/python3.7/site-packages/discord/ext/commands/core.py", line 88, in wrapped
      raise CommandInvokeError(exc) from exc
  discord.ext.commands.errors.CommandInvokeError: Command raised an exception: Forbidden: 403 FORBIDDEN (error code: 50013): Missing Permissions```
  
  Trace taken from BB-8
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `redbot/core/global_checks.py`
  Content:
  ```
  1 """The checks in this module run on every command."""
  2 from . import commands
  3 
  4 
  5 def init_global_checks(bot):
  6     @bot.check_once
  7     def actually_up(ctx):
  8         """ 
  9         Uptime is set during the initial startup process.
  10         If this hasn't been set, we should assume the bot isn't ready yet. 
  11         """
  12         return ctx.bot.uptime is not None
  13 
  14     @bot.check_once
  15     async def whiteblacklist_checks(ctx):
  16         return await ctx.bot.allowed_by_whitelist_blacklist(ctx.author)
  17 
  18     @bot.check_once
  19     def bots(ctx):
  20         """Check the user is not another bot."""
  21         return not ctx.author.bot
  22
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/redbot/core/global_checks.py b/redbot/core/global_checks.py
  --- a/redbot/core/global_checks.py
  +++ b/redbot/core/global_checks.py
  @@ -4,7 +4,17 @@
   
   def init_global_checks(bot):
       @bot.check_once
  -    def actually_up(ctx):
  +    def minimum_bot_perms(ctx) -> bool:
  +        """
  +        Too many 403, 401, and 429 Errors can cause bots to get global'd
  +        
  +        It's reasonable to assume the below as a minimum amount of perms for
  +        commands.
  +        """
  +        return ctx.channel.permissions_for(ctx.me).send_messages
  +
  +    @bot.check_once
  +    def actually_up(ctx) -> bool:
           """ 
           Uptime is set during the initial startup process.
           If this hasn't been set, we should assume the bot isn't ready yet. 
  @@ -12,10 +22,10 @@
           return ctx.bot.uptime is not None
   
       @bot.check_once
  -    async def whiteblacklist_checks(ctx):
  +    async def whiteblacklist_checks(ctx) -> bool:
           return await ctx.bot.allowed_by_whitelist_blacklist(ctx.author)
   
       @bot.check_once
  -    def bots(ctx):
  +    def bots(ctx) -> bool:
           """Check the user is not another bot."""
           return not ctx.author.bot
  
verification_info: {"golden_diff": "diff --git a/redbot/core/global_checks.py b/redbot/core/global_checks.py\n--- a/redbot/core/global_checks.py\n+++ b/redbot/core/global_checks.py\n@@ -4,7 +4,17 @@\n \n def init_global_checks(bot):\n     @bot.check_once\n-    def actually_up(ctx):\n+    def minimum_bot_perms(ctx) -> bool:\n+        \"\"\"\n+        Too many 403, 401, and 429 Errors can cause bots to get global'd\n+        \n+        It's reasonable to assume the below as a minimum amount of perms for\n+        commands.\n+        \"\"\"\n+        return ctx.channel.permissions_for(ctx.me).send_messages\n+\n+    @bot.check_once\n+    def actually_up(ctx) -> bool:\n         \"\"\" \n         Uptime is set during the initial startup process.\n         If this hasn't been set, we should assume the bot isn't ready yet. \n@@ -12,10 +22,10 @@\n         return ctx.bot.uptime is not None\n \n     @bot.check_once\n-    async def whiteblacklist_checks(ctx):\n+    async def whiteblacklist_checks(ctx) -> bool:\n         return await ctx.bot.allowed_by_whitelist_blacklist(ctx.author)\n \n     @bot.check_once\n-    def bots(ctx):\n+    def bots(ctx) -> bool:\n         \"\"\"Check the user is not another bot.\"\"\"\n         return not ctx.author.bot\n", "issue": "[crash] bank balance  - when the bot doesnt have perms to send message\n```Traceback (most recent call last):\r\n  File \"/home/bb8/venv/lib/python3.7/site-packages/discord/ext/commands/core.py\", line 79, in wrapped\r\n    ret = await coro(*args, **kwargs)\r\n  File \"/home/bb8/venv/lib/python3.7/site-packages/redbot/cogs/economy/economy.py\", line 174, in balance\r\n    user=user.display_name, num=humanize_number(bal), currency=currency\r\n  File \"/home/bb8/venv/lib/python3.7/site-packages/redbot/core/commands/context.py\", line 81, in send\r\n    return await super().send(content=content, **kwargs)\r\n  File \"/home/bb8/venv/lib/python3.7/site-packages/discord/abc.py\", line 823, in send\r\n    data = await state.http.send_message(channel.id, content, tts=tts, embed=embed, nonce=nonce)\r\n  File \"/home/bb8/venv/lib/python3.7/site-packages/discord/http.py\", line 218, in request\r\n    raise Forbidden(r, data)\r\ndiscord.errors.Forbidden: 403 FORBIDDEN (error code: 50013): Missing Permissions\r\n\r\nThe above exception was the direct cause of the following exception:\r\n\r\nTraceback (most recent call last):\r\n  File \"/home/bb8/venv/lib/python3.7/site-packages/discord/ext/commands/bot.py\", line 863, in invoke\r\n    await ctx.command.invoke(ctx)\r\n  File \"/home/bb8/venv/lib/python3.7/site-packages/redbot/core/commands/commands.py\", line 587, in invoke\r\n    await super().invoke(ctx)\r\n  File \"/home/bb8/venv/lib/python3.7/site-packages/discord/ext/commands/core.py\", line 1158, in invoke\r\n    await ctx.invoked_subcommand.invoke(ctx)\r\n  File \"/home/bb8/venv/lib/python3.7/site-packages/discord/ext/commands/core.py\", line 728, in invoke\r\n    await injected(*ctx.args, **ctx.kwargs)\r\n  File \"/home/bb8/venv/lib/python3.7/site-packages/discord/ext/commands/core.py\", line 88, in wrapped\r\n    raise CommandInvokeError(exc) from exc\r\ndiscord.ext.commands.errors.CommandInvokeError: Command raised an exception: Forbidden: 403 FORBIDDEN (error code: 50013): Missing Permissions```\r\n\r\nTrace taken from BB-8\n", "before_files": [{"content": "\"\"\"The checks in this module run on every command.\"\"\"\nfrom . import commands\n\n\ndef init_global_checks(bot):\n    @bot.check_once\n    def actually_up(ctx):\n        \"\"\" \n        Uptime is set during the initial startup process.\n        If this hasn't been set, we should assume the bot isn't ready yet. \n        \"\"\"\n        return ctx.bot.uptime is not None\n\n    @bot.check_once\n    async def whiteblacklist_checks(ctx):\n        return await ctx.bot.allowed_by_whitelist_blacklist(ctx.author)\n\n    @bot.check_once\n    def bots(ctx):\n        \"\"\"Check the user is not another bot.\"\"\"\n        return not ctx.author.bot\n", "path": "redbot/core/global_checks.py"}], "after_files": [{"content": "\"\"\"The checks in this module run on every command.\"\"\"\nfrom . import commands\n\n\ndef init_global_checks(bot):\n    @bot.check_once\n    def minimum_bot_perms(ctx) -> bool:\n        \"\"\"\n        Too many 403, 401, and 429 Errors can cause bots to get global'd\n        \n        It's reasonable to assume the below as a minimum amount of perms for\n        commands.\n        \"\"\"\n        return ctx.channel.permissions_for(ctx.me).send_messages\n\n    @bot.check_once\n    def actually_up(ctx) -> bool:\n        \"\"\" \n        Uptime is set during the initial startup process.\n        If this hasn't been set, we should assume the bot isn't ready yet. \n        \"\"\"\n        return ctx.bot.uptime is not None\n\n    @bot.check_once\n    async def whiteblacklist_checks(ctx) -> bool:\n        return await ctx.bot.allowed_by_whitelist_blacklist(ctx.author)\n\n    @bot.check_once\n    def bots(ctx) -> bool:\n        \"\"\"Check the user is not another bot.\"\"\"\n        return not ctx.author.bot\n", "path": "redbot/core/global_checks.py"}]}