From 2ae965df4a72197535fb985d77ece77e3282d5b7 Mon Sep 17 00:00:00 2001 From: Giovanni Harting <539@idlegandalf.com> Date: Tue, 18 Dec 2018 17:24:34 +0100 Subject: [PATCH] switched wordlist and added alphanumeric check --- modules/autochannel.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/autochannel.py b/modules/autochannel.py index 71cfb37..5306b84 100644 --- a/modules/autochannel.py +++ b/modules/autochannel.py @@ -38,7 +38,7 @@ class autochannel(MumoModule): self.top_list = None # Load wordlist - r = requests.get("https://svnweb.freebsd.org/csrg/share/dict/words?view=co&content-type=text/plain") + r = requests.get("https://raw.githubusercontent.com/dwyl/english-words/master/words.txt") if r.status_code == 200: self.wordlist = r.text.splitlines() @@ -109,7 +109,12 @@ class autochannel(MumoModule): self.add_random_channel(server) def add_random_channel(self, server): - server.addChannel(self.wordlist[random.randint(0, len(self.wordlist))], self.root.id) + word = self.wordlist[random.randint(0, len(self.wordlist))] + + while not word.isalnum(): + word = self.wordlist[random.randint(0, len(self.wordlist))] + + server.addChannel(word, self.root.id) # # --- Meta callback functions