def update(self, ctx, region: str):
"""Update your server's default region"""
try:
Summoner(name="", region=region)
except ValueError:
embed = discord.Embed(
title="Error!",
description="{0} is not a valid region!".format(region),
colour=0xCA0147)
utils.footer(ctx, embed)
await ctx.send("", embed=embed)
return
db = database.Database('guilds.db')
try:
db.find_entry(ctx.guild.id)
db.update_entry(ctx.guild.id, region)
db.close_connection()
embed = discord.Embed(
title='Success!',
description="Set {0} as {1}'s default region!".format(
region, ctx.guild.name),
colour=0x1AFFA7)
utils.footer(ctx, embed)
await ctx.send("", embed=embed)
except TypeError:
db.close_connection()
embed = discord.Embed(
title="Error!",
description="A default region for this server has not been set!",
colour=0xCA0147)
utils.footer(ctx, embed)
await ctx.send("", embed=embed)
评论列表
文章目录