mirror of
https://github.com/brandons209/Red-bot-Cogs.git
synced 2024-06-27 02:20:44 +12:00
fix config write
This commit is contained in:
parent
88eb4b4f1c
commit
9b193228e6
|
@ -78,12 +78,12 @@ class ScriptCog:
|
|||
if os.path.isfile("data/scriptcog/config.txt"):
|
||||
with open("data/scriptcog/config.txt", "r") as f:
|
||||
content = f.read()
|
||||
content = content.split("\n")
|
||||
content = content.split()
|
||||
self.word_limit = int(content[0])
|
||||
self.cooldown_limit = int(content[1])
|
||||
else:
|
||||
with open("data/scriptcog/config.txt", "w") as f:
|
||||
f.write("100\n30")
|
||||
f.write("100 30")
|
||||
self.word_limit = 100
|
||||
self.cooldown_limit = 30
|
||||
|
||||
|
@ -98,7 +98,7 @@ class ScriptCog:
|
|||
|
||||
def _write_config(self):
|
||||
with open("data/scriptcog/config.txt", "w") as f:
|
||||
f.write("{}\n{}".format(self.word_limit, self.cooldown_limit))
|
||||
f.write("{} {}".format(self.word_limit, self.cooldown_limit))
|
||||
|
||||
@commands.command(pass_context=True, no_pm=True)
|
||||
async def setwordlimit(self, ctx, num_words : int = 100):
|
||||
|
|
Loading…
Reference in a new issue