I am currently making a Discord Bot with discord.py and has YAML configs. Here is a short YAML config taken from my "hartexConfig.yaml" file:
general:
hartexToken = 'the bot token'
then I try to access it in the hartex.py file:
class Hartex(discord.Client):
def __init__(self, *args, **kwargs):
super().__init__()
hartexTokenValue = open('HarTex/hartexConfig.yaml', 'r')
hartexToken = hartexTokenValue['general']['hartexToken']
yamlStream = True
How can I do this or am I completely wrong?
PS I meant to access a specific piece of data, like in this case, I want to read ONLY the hartexToken from the YAML file.