mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -05:00
[V3] Set token command (#1425)
* [V3] Add set token command * DM check * warning message + delete if token isn't send in DM * Update string formatting
This commit is contained in:
parent
27b61a2770
commit
749af89e9f
@ -575,6 +575,27 @@ class Core:
|
||||
else:
|
||||
await ctx.send(_("Invalid token."))
|
||||
|
||||
@_set.command()
|
||||
@checks.is_owner()
|
||||
async def token(self, ctx, token: str):
|
||||
"""Change bot token."""
|
||||
if not not isinstance(ctx.channel, discord.DMChannel):
|
||||
|
||||
try:
|
||||
await ctx.message.delete()
|
||||
except discord.Forbidden:
|
||||
pass
|
||||
|
||||
await ctx.send(
|
||||
_("Please use that command in DM. Since users probably saw your token,"
|
||||
" it is recommended to reset it right now. Go to the following link and"
|
||||
" select `Reveal Token` and `Generate a new token?`."
|
||||
"\n\nhttps://discordapp.com/developers/applications/me/{}").format(self.bot.user.id))
|
||||
return
|
||||
|
||||
await ctx.bot.db.token.set(token)
|
||||
await ctx.send("Token set. Restart me.")
|
||||
|
||||
@_set.command()
|
||||
@checks.is_owner()
|
||||
async def locale(self, ctx: commands.Context, locale_name: str):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user