Conversation
Added a way to see the users activity in the user info command. This requires the lastest version of discord.py rewrite branch
| @commands.command() | ||
| @check_reddit | ||
| async def headpat(self, ctx): | ||
| ''' Gets a random headpat image from /headpats ''' |
There was a problem hiding this comment.
Shouldn't it be /r/headpats, not /headpats?
| f'Duration: {str(activity.duration).split(".")[0]}', | ||
| ] | ||
| embed.add_field(name='Listening to:', value='\n'.join(actitivty_info)) | ||
| embed.color = 1947988 |
There was a problem hiding this comment.
Instead of magic constant colors, they should be constants, like STREAMING_COLOR or something.
| for member in guild.members: | ||
| if member.id == user_id: | ||
| return member | ||
|
|
There was a problem hiding this comment.
You can see if you like the discord.utils.get() implementation instead:
def _get_member(self, user_id):
for guild in self.bot.guilds:
member = discord.utils.get(guild, id=user_id)
if member is not None:
return member
return NoneThere was a problem hiding this comment.
Also it should explicitly return None if no member is found.
| CHANNEL_REGEX = re.compile(r'<#([0-9]+)>') | ||
| MENTION_REGEX = re.compile(r'<@!?([0-9]+)>') | ||
| EMOJI_REGEX = re.compile(r'<:([A-Za-z~\-0-9]+):([0-9]+)>') | ||
| SPOTIFY_OPEN_URL = 'http://open.spotify.com/track/' |
There was a problem hiding this comment.
I think you should have an empty space between the "regex constants" and the "url constants".
There was a problem hiding this comment.
Also, given that you have this constant, is it worth making the other profile links (e.g. facebook, twitch) also be *_URL constants?
|
|
||
| member = self._get_member(user.id) | ||
| activity = member.activity | ||
|
|
There was a problem hiding this comment.
I understand removing user.game stuff, but why was user.voice and similar code removed?
| @commands.command() | ||
| @check_reddit | ||
| async def megane(self, ctx): | ||
| ''' Gets a random megane image from /megane ''' |
| @commands.command() | ||
| @check_reddit | ||
| async def hentai(self, ctx): | ||
| ''' Gets a random image from /hentai ''' |
Added a way to see the users activity in the user info command. This requires the latest version of discord.py rewrite branch. This will need to be tidied up and make to look nicer
This also add doc string to the reddit commands