diff --git a/.version b/.version index 5c4511c3..6c6aa7cb 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -0.0.7 \ No newline at end of file +0.1.0 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 36305e6c..2d6c6156 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ # Reaction Light - Changelog +### 0.1.0 +- Add Windows compatibility + ### 0.0.7 - Add system channel updating via Discord (using the `rl!systemchannel` command) diff --git a/README.md b/README.md index 960b0bb9..83e9d006 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Reaction Light - Discord Role Bot -![Reaction Light 0.0.7](https://img.shields.io/badge/Reaction%20Light-0.0.7-yellow.svg) +![Reaction Light 0.1.0](https://img.shields.io/badge/Reaction%20Light-0.1.0-yellow.svg) ![Python 3.5.3+](https://img.shields.io/badge/python-3.5.3+-blue.svg) ![discord.py rewrite](https://img.shields.io/badge/discord.py-1.2.5+-blue.svg) diff --git a/bot.py b/bot.py index 1406e16c..9eee5cf1 100644 --- a/bot.py +++ b/bot.py @@ -10,9 +10,9 @@ # Original Repository: https://github.com/eibex/reaction-light -__author__ = "eibex" -__version__ = "0.0.7" -__license__ = "MIT" +# License: MIT - Copyright 2019-2020 eibex + +__version__ = "0.1.0" directory = path.dirname(path.realpath(__file__)) folder = f"{directory}/files" diff --git a/rlightfm.py b/rlightfm.py index e373a3dd..b96c1468 100644 --- a/rlightfm.py +++ b/rlightfm.py @@ -3,6 +3,9 @@ from os import path import csv +# Original Repository: https://github.com/eibex/reaction-light +# License: MIT - Copyright 2019-2020 eibex + folder = f"{path.dirname(path.realpath(__file__))}/files" wizard = {} wizardcache = {} @@ -13,7 +16,7 @@ def readcache(): # Reads cache.csv and stores into the dictionary # Run at the start of the program and updated when changes are made try: - with open(f"{folder}/cache.csv", "r") as f: + with open(f"{folder}/cache.csv", "r", encoding="utf-8") as f: read = csv.reader(f, delimiter=",") for row in read: cache[row[0]] = row[1] @@ -42,15 +45,15 @@ def getch(r): def getcombo(r): # Returns the reaction-role combinations - with open(f"{folder}/{r}.csv", "r") as f: + with open(f"{folder}/{r}.csv", "r", encoding="utf-8") as f: read = csv.reader(f, delimiter=",") return [i for i in read] def addids(message_id, r): # Adds the embed ID and CSV filename to the cache - with open(f"{folder}/cache.csv", "a") as f: - w = csv.writer(f, delimiter=",") + with open(f"{folder}/cache.csv", "a", encoding="utf-8") as f: + w = csv.writer(f, delimiter=",", lineterminator="\n") w.writerow([message_id, r]) @@ -63,7 +66,7 @@ def getids(message_id): def getreactions(r): # Returns a list of the reactions used by a certain embed - with open(f"{folder}/{r}.csv", "r") as f: + with open(f"{folder}/{r}.csv", "r", encoding="utf-8") as f: read = csv.reader(f, delimiter=",") reactions = {} for row in read: @@ -82,7 +85,7 @@ def listen(user, channel): ids = {} try: - with open(f"{folder}/id.csv", "r") as f: + with open(f"{folder}/id.csv", "r", encoding="utf-8") as f: read = csv.reader(f, delimiter=",") for i in read: ids[i[0]] = i[1:] @@ -92,8 +95,8 @@ def listen(user, channel): print("Creating id.csv") ids[r] = [str(user), str(channel)] - with open(f"{folder}/id.csv", "w") as f: - w = csv.writer(f, delimiter=",") + with open(f"{folder}/id.csv", "w", encoding="utf-8") as f: + w = csv.writer(f, delimiter=",", lineterminator="\n") for i in ids: row = [i, ids[i][0], ids[i][1]] w.writerow(row) @@ -119,8 +122,8 @@ def step2(r, role, emoji, done=False): global wizardcache if done: wizard[r][3] += 1 # Set step3 (was 2) - with open(f"{folder}/{r}.csv", "a") as f: - w = csv.writer(f, delimiter=",") + with open(f"{folder}/{r}.csv", "a", encoding="utf-8") as f: + w = csv.writer(f, delimiter=",", lineterminator="\n") for i in wizardcache[r]: w.writerow(i) print("Done adding combos and saved.") @@ -135,7 +138,7 @@ def edit(role_channel): r_ids = {} for msg_id in cache: r = cache[msg_id] - with open(f"{folder}/{r}.csv", "r") as f: + with open(f"{folder}/{r}.csv", "r", encoding="utf-8") as f: read = csv.reader(f, delimiter=",") for row in read: channel = int(row[0]) diff --git a/setup.py b/setup.py index aa2d418a..dbcf62fc 100644 --- a/setup.py +++ b/setup.py @@ -3,8 +3,9 @@ import configparser # Original Repository: https://github.com/eibex/reaction-light +# License: MIT - Copyright 2019-2020 eibex print("Author: eibex") -print("Version: 0.0.7") +print("Version: 0.1.0") print("License: MIT\n") print("### ### Reaction Light Setup ### ###")