mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-07 01:42:30 -05:00
Sentry error logging (#784)
This commit is contained in:
21
core/cli.py
21
core/cli.py
@@ -1,6 +1,8 @@
|
||||
import argparse
|
||||
import asyncio
|
||||
|
||||
from core.bot import Red
|
||||
|
||||
|
||||
def confirm(m=""):
|
||||
return input(m).lower().strip() in ("y", "yes")
|
||||
@@ -39,9 +41,26 @@ def interactive_config(red, token_set, prefix_set):
|
||||
if prefix:
|
||||
loop.run_until_complete(red.db.set("prefix", [prefix]))
|
||||
|
||||
ask_sentry(red)
|
||||
|
||||
return token
|
||||
|
||||
|
||||
def ask_sentry(red: Red):
|
||||
loop = asyncio.get_event_loop()
|
||||
print("\nThank you for installing Red V3 alpha! The current version\n"
|
||||
" is not suited for production use and is aimed at testing\n"
|
||||
" the current and upcoming featureset, that's why we will\n"
|
||||
" also collect the fatal error logs to help us fix any new\n"
|
||||
" found issues in a timely manner. If you wish to opt in\n"
|
||||
" the process please type \"yes\":\n")
|
||||
if not confirm("> "):
|
||||
loop.run_until_complete(red.db.set("enable_sentry", False))
|
||||
else:
|
||||
loop.run_until_complete(red.db.set("enable_sentry", True))
|
||||
print("\nThank you for helping us with the development process!")
|
||||
|
||||
|
||||
def parse_cli_flags():
|
||||
parser = argparse.ArgumentParser(description="Red - Discord Bot")
|
||||
parser.add_argument("--owner", help="ID of the owner. Only who hosts "
|
||||
@@ -83,4 +102,4 @@ def parse_cli_flags():
|
||||
else:
|
||||
args.prefix = []
|
||||
|
||||
return args
|
||||
return args
|
||||
|
||||
Reference in New Issue
Block a user