diff --git a/kabot/kabot/kabot.py b/kabot/kabot/kabot.py index bc444e3..e7d2742 100644 --- a/kabot/kabot/kabot.py +++ b/kabot/kabot/kabot.py @@ -137,7 +137,8 @@ class Mybot(commands.Cog): async def contrepeterie(self, ctx, *args): response = None path = here + '/ressources/contrepeteries.txt' - lines = open(path).read().splitlines() + with open(path) as file: + lines = file.read().splitlines() myline = random.choice(lines) try: