Repository: Cog-Creators/Red-DiscordBot

Issue:
 'ClientUser' object has no attribute 'status'
### Type:

- [ ] Suggestion
- [X] Bug

### Brief description of the problem
Whilst trying to set what RED is listening to, she chooses to rather error out than be of use.
### Expected behavior
Show the documentation for [p]set listening
### Actual behavior
```
AttributeError: 'ClientUser' object has no attribute 'status'
[20/02/2018 01:34] ERROR events on_command_error 165: Exception in command 'set listening'
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/discord/ext/commands/core.py", line 62, in wrapped
    ret = yield from coro(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/redbot/core/core_commands.py", line 379, in _listening
    status = ctx.me.status
AttributeError: 'ClientUser' object has no attribute 'status'
```
### Steps to reproduce
(Edited)
1. Type one of the following:

- [p]set listening
- [p]set watching



Discussion:

Resolving patch:
diff --git a/redbot/core/core_commands.py b/redbot/core/core_commands.py
--- a/redbot/core/core_commands.py
+++ b/redbot/core/core_commands.py
@@ -375,10 +375,14 @@ async def avatar(self, ctx, url: str):
 
     @_set.command(name="game")
     @checks.is_owner()
-    @commands.guild_only()
     async def _game(self, ctx, *, game: str=None):
-        """Sets Red's playing status"""
-        status = ctx.me.status
+        """Sets Red's playing status
+
+        Can only be run if the bot is in a server."""
+        if len(ctx.bot.guilds) == 0:
+            await ctx.send_help()
+            return
+        status = ctx.bot.guilds[0].me.status
         if game:
             game = discord.Game(name=game)
         else:
@@ -389,8 +393,13 @@ async def _game(self, ctx, *, game: str=None):
     @_set.command(name="listening")
     @checks.is_owner()
     async def _listening(self, ctx, *, listening: str=None):
-        """Sets Red's listening status"""
-        status = ctx.me.status
+        """Sets Red's listening status
+
+        Can only be run if the bot is in a server."""
+        if len(ctx.bot.guilds) == 0:
+            await ctx.send_help()
+            return
+        status = ctx.bot.guilds[0].me.status
         if listening:
             listening = discord.Game(name=listening, type=2)
         else:
@@ -401,8 +410,13 @@ async def _listening(self, ctx, *, listening: str=None):
     @_set.command(name="watching")
     @checks.is_owner()
     async def _watching(self, ctx, *, watching: str=None):
-        """Sets Red's watching status"""
-        status = ctx.me.status
+        """Sets Red's watching status
+
+        Can only be run if the bot is in a server."""
+        if len(ctx.bot.guilds) == 0:
+            await ctx.send_help()
+            return
+        status = ctx.bot.guilds[0].me.status
         if watching:
             watching = discord.Game(name=watching, type=3)
         else:
@@ -412,23 +426,28 @@ async def _watching(self, ctx, *, watching: str=None):
         
     @_set.command()
     @checks.is_owner()
-    @commands.guild_only()
     async def status(self, ctx, *, status: str):
         """Sets Red's status
+
         Available statuses:
             online
             idle
             dnd
-            invisible"""
+            invisible
+
+        Can only be run if the bot is in a server."""
 
         statuses = {
-                    "online"    : discord.Status.online,
-                    "idle"      : discord.Status.idle,
-                    "dnd"       : discord.Status.dnd,
-                    "invisible" : discord.Status.invisible
-                   }
+            "online": discord.Status.online,
+            "idle": discord.Status.idle,
+            "dnd": discord.Status.dnd,
+            "invisible": discord.Status.invisible
+        }
 
-        game = ctx.me.game
+        if len(ctx.bot.guilds) == 0:
+            await ctx.send_help()
+            return
+        game = ctx.bot.guilds[0].me.game
 
         try:
             status = statuses[status.lower()]
@@ -441,12 +460,14 @@ async def status(self, ctx, *, status: str):
 
     @_set.command()
     @checks.is_owner()
-    @commands.guild_only()
     async def stream(self, ctx, streamer=None, *, stream_title=None):
         """Sets Red's streaming status
         Leaving both streamer and stream_title empty will clear it."""
 
-        status = ctx.me.status
+        if len(ctx.bot.guilds) == 0:
+            await ctx.send_help()
+            return
+        status = ctx.bot.guilds[0].me.status
 
         if stream_title:
             stream_title = stream_title.strip()


Test patch: