Skip to content

Commit

Permalink
Start updating internal api endpoints to new ones
Browse files Browse the repository at this point in the history
  • Loading branch information
kyb3r committed Dec 31, 2018
1 parent 0151cbb commit 645adf1
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
SOFTWARE.
'''

__version__ = '1.5.2'
__version__ = '1.5.3'

from contextlib import redirect_stdout
from urllib.parse import urlparse
Expand Down Expand Up @@ -206,6 +206,8 @@ async def on_command_error(self, ctx, error):
em.title = f'`{prefix}{ctx.command.signature}`'
em.description = ctx.command.help
await ctx.send(embed=em)
else:
raise error

def overwrites(self, ctx, modrole=None):
'''Permision overwrites for the guild.'''
Expand Down Expand Up @@ -280,7 +282,7 @@ async def data_loop(self):
"version": __version__
}

await self.session.post('https://api.kybr.tk/modmail', json=data)
await self.session.post('https://api.modmail.tk/metadata', json=data)

await asyncio.sleep(3600)

Expand Down Expand Up @@ -341,7 +343,7 @@ async def about(self, ctx):
'easily communicate with server leadership in an organised manner.'

try:
async with self.session.get('https://api.kybr.tk/modmail') as resp:
async with self.session.get('https://api.modmail.tk/metadata') as resp:
meta = await resp.json()
except:
meta = None
Expand Down Expand Up @@ -916,6 +918,9 @@ async def contact(self, ctx, *, user: discord.Member=None):
reopen = True
if not user:
return await ctx.send('This user does not share any servers with the bot and is thus unreachable.')

if not user:
raise commands.UserInputError('user must be provided')

categ = discord.utils.get(ctx.guild.categories, id=ctx.channel.category_id)
channel = await self.find_or_create_thread(user, creator=ctx.author, reopen=reopen)
Expand Down

0 comments on commit 645adf1

Please sign in to comment.