GoldyBot.token

 1import GoldyBot
 2
 3MODULE_NAME = "TOKEN"
 4
 5def get() -> str:
 6    """Commands goldy bot to get the token."""
 7    file = GoldyBot.files.File(GoldyBot.paths.TOKEN)
 8    token = file.read()
 9
10    if token in ["", "{ENTER BOT TOKEN HERE}", None]:
11        GoldyBot.log("error", "Please enter your discord token in the 'TOKEN.txt' file located in 'config' and run Goldy Bot again.")
12        file.write("{ENTER BOT TOKEN HERE}")
13
14        # Stop bot immediately.
15        GoldyBot.Goldy().stop("There's no Discord Token!")
16
17    else:
18        return token
19
20def get_database() -> str:
21    """Commands goldy bot to get the database url token."""
22    file = GoldyBot.files.File(GoldyBot.paths.DATABASE_TOKEN)
23    database_token = file.read()
24
25    if database_token in ["", "{ENTER DATABASE URL HERE}", None]:
26        GoldyBot.log("error", "Please enter your MongoDB database URL in the 'DATABASE_TOKEN.txt' file located in 'config' and run Goldy Bot again.")
27        file.write("{ENTER DATABASE URL HERE}")
28
29        # Stop bot immediately.
30        GoldyBot.Goldy().stop("There's no MongoDB database URL!")
31
32    else:
33        return database_token
def get() -> str:
 6def get() -> str:
 7    """Commands goldy bot to get the token."""
 8    file = GoldyBot.files.File(GoldyBot.paths.TOKEN)
 9    token = file.read()
10
11    if token in ["", "{ENTER BOT TOKEN HERE}", None]:
12        GoldyBot.log("error", "Please enter your discord token in the 'TOKEN.txt' file located in 'config' and run Goldy Bot again.")
13        file.write("{ENTER BOT TOKEN HERE}")
14
15        # Stop bot immediately.
16        GoldyBot.Goldy().stop("There's no Discord Token!")
17
18    else:
19        return token

Commands goldy bot to get the token.

def get_database() -> str:
21def get_database() -> str:
22    """Commands goldy bot to get the database url token."""
23    file = GoldyBot.files.File(GoldyBot.paths.DATABASE_TOKEN)
24    database_token = file.read()
25
26    if database_token in ["", "{ENTER DATABASE URL HERE}", None]:
27        GoldyBot.log("error", "Please enter your MongoDB database URL in the 'DATABASE_TOKEN.txt' file located in 'config' and run Goldy Bot again.")
28        file.write("{ENTER DATABASE URL HERE}")
29
30        # Stop bot immediately.
31        GoldyBot.Goldy().stop("There's no MongoDB database URL!")
32
33    else:
34        return database_token

Commands goldy bot to get the database url token.