mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 10:17:59 -05:00
Rename bot.db as bot._config (#2967)
* Rename `bot.db` as `bot._config` - Continues work towards strong version guarantees - Added methods for cog use for a few things which were previously only accessible via direct access. - Retained private use in a few internal use locations, though most methods were updated away from this. - Updated documentation for shared api token users * changelog * more detail * docstring fixes * Apparently, I forgot to commit something I had locally - + a copy/paste failue in the changelog * *sigh*: * *sigh*
This commit is contained in:
@@ -52,8 +52,8 @@ async def _get_prefix_and_token(red, indict):
|
||||
:param indict:
|
||||
:return:
|
||||
"""
|
||||
indict["token"] = await red.db.token()
|
||||
indict["prefix"] = await red.db.prefix()
|
||||
indict["token"] = await red._config.token()
|
||||
indict["prefix"] = await red._config.prefix()
|
||||
|
||||
|
||||
def list_instances():
|
||||
@@ -115,7 +115,7 @@ def main():
|
||||
red = Red(
|
||||
cli_flags=cli_flags, description=description, dm_help=None, fetch_offline_members=True
|
||||
)
|
||||
loop.run_until_complete(red.maybe_update_config())
|
||||
loop.run_until_complete(red._maybe_update_config())
|
||||
init_global_checks(red)
|
||||
init_events(red, cli_flags)
|
||||
|
||||
@@ -153,11 +153,11 @@ def main():
|
||||
loop.run_until_complete(red.start(token, bot=True))
|
||||
except discord.LoginFailure:
|
||||
log.critical("This token doesn't seem to be valid.")
|
||||
db_token = loop.run_until_complete(red.db.token())
|
||||
db_token = loop.run_until_complete(red._config.token())
|
||||
if db_token and not cli_flags.no_prompt:
|
||||
print("\nDo you want to reset the token? (y/n)")
|
||||
if confirm("> "):
|
||||
loop.run_until_complete(red.db.token.set(""))
|
||||
loop.run_until_complete(red._config.token.set(""))
|
||||
print("Token has been reset.")
|
||||
except KeyboardInterrupt:
|
||||
log.info("Keyboard interrupt detected. Quitting...")
|
||||
|
||||
Reference in New Issue
Block a user