Skip to content

Commit

Permalink
Remote unused discord import + fix autoreload
Browse files Browse the repository at this point in the history
  • Loading branch information
iiPythonx committed Oct 5, 2021
1 parent 1d7080f commit f593fd0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion prism/cmds/currency/balance.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Copyright 2021 iiPython

# Modules
import discord
from discord.ext import commands

# Command class
Expand Down
9 changes: 4 additions & 5 deletions prism/cmds/dev/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,12 @@ def ch_count(path):

# Handle autoreload
self.bot.log("info", "Debugging reloader started.")
for command in commands:
self.autoreload_cache[command] = ch_count(command)

await self.bot.wait_until_ready()
while not self.bot.is_closed():

# Loop through commands
for command in commands:
self.autoreload_cache[command] = ch_count(command)

# Check for a file change
for command in commands:
chars = ch_count(command)
Expand All @@ -105,7 +103,8 @@ def ch_count(path):

# Check if file is valid to reload
try:
ast.parse(open(command, "r", encoding = "UTF-8").read())
with open(command, "r", encoding = "utf8") as f:
ast.parse(f.read())

# Reload extension
self.unload_module(command.replace(".py", "").replace("/", "."))
Expand Down

0 comments on commit f593fd0

Please sign in to comment.