def alias(self, ctx, alias):
"""Create D.io link"""
key = self.loadapi["ApiKey"]
inv = await self.bot.create_invite(ctx.message.server, unique=False)
async with aiohttp.ClientSession() as session:
async with session.get('https://discord.io/api?api={0}&url={1}'.format(key, inv) + "&custom=" + alias + '&format=text') as resp:
print(resp.status)
try:
await self.bot.say(await resp.text())
except discord.errors.HTTPException:
await self.bot.say("Link already exists, or the alias is reserved for Pro users.")
评论列表
文章目录