Skip to content

Commit

Permalink
Strip slash from selfhosted log url
Browse files Browse the repository at this point in the history
  • Loading branch information
kyb3r committed Jan 20, 2019
1 parent 5f0f293 commit b5bbe01
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cogs/modmail.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ async def logs(self, ctx, *, member: Union[discord.Member, discord.User, obj]=No

key = entry['_id']
closer = entry['closer']['name']
log_url = f"https://logs.modmail.tk/{key}" if not self.bot.selfhosted else self.bot.config.log_url + f'/logs/{key}'
log_url = f"https://logs.modmail.tk/{key}" if not self.bot.selfhosted else self.bot.config.log_url.strip('/') + f'/logs/{key}'

truncate = lambda c: c[:47].strip() + '...' if len(c) > 50 else c

Expand Down
2 changes: 1 addition & 1 deletion core/clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ async def get_log_url(self, recipient, channel, creator):
'messages': []
})

return f'{self.app.config.log_url}/logs/{key}'
return f"{self.app.config.log_url.strip('/')}/logs/{key}"

async def get_config(self):
conf = await self.db.config.find_one({'bot_id': self.app.user.id})
Expand Down
5 changes: 2 additions & 3 deletions core/thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,9 @@ async def _close(self, closer, silent=False, delete_channel=True,
return

if self.bot.selfhosted:
log_url = f'{self.bot.config.log_url}/logs/{log_data["key"]}'
log_url = f"{self.bot.config.log_url.strip('/')}/logs/{log_data["key"]}"
else:
log_url = f"https://logs.modmail.tk/" \
f"{log_data['key']}"
log_url = f"https://logs.modmail.tk/{log_data['key']}"

user = self.recipient.mention if self.recipient else f'`{self.id}`'

Expand Down

0 comments on commit b5bbe01

Please sign in to comment.