diff --git a/werewolf/builder.py b/werewolf/builder.py index fbf5a1c..eff1f00 100644 --- a/werewolf/builder.py +++ b/werewolf/builder.py @@ -3,15 +3,13 @@ from collections import defaultdict from random import choice import discord -from discord.ext import commands - # Import all roles here from redbot.core import RedContext +from redbot.core.utils.menus import menu, prev_page, next_page, close_menu from werewolf.roles.seer import Seer from werewolf.roles.vanillawerewolf import VanillaWerewolf from werewolf.roles.villager import Villager -from redbot.core.utils.menus import menu, prev_page, next_page, close_menu # All roles in this list for iterating @@ -120,8 +118,6 @@ async def parse_code(code, game): digits += 1 continue - - try: idx = int(built) except ValueError: @@ -146,7 +142,6 @@ async def parse_code(code, game): built = "" - return decode @@ -321,7 +316,7 @@ class GameBuilder: pass if page >= len(ROLE_LIST): - self.rand_roles.append(CATEGORY_COUNT[page-len(ROLE_LIST)]) + self.rand_roles.append(CATEGORY_COUNT[page - len(ROLE_LIST)]) else: self.code.append(page) diff --git a/werewolf/game.py b/werewolf/game.py index 344f145..1848fe6 100644 --- a/werewolf/game.py +++ b/werewolf/game.py @@ -2,7 +2,6 @@ import asyncio import random import discord -from discord.ext import commands from redbot.core import RedContext from werewolf.builder import parse_code diff --git a/werewolf/player.py b/werewolf/player.py index d1f9359..c84d87f 100644 --- a/werewolf/player.py +++ b/werewolf/player.py @@ -30,4 +30,4 @@ class Player: try: await self.member.send(message) # Lets do embeds later except discord.Forbidden: - await self.role.game.village_channel.send("Couldn't DM {}, uh oh".format(self.mention)) \ No newline at end of file + await self.role.game.village_channel.send("Couldn't DM {}, uh oh".format(self.mention)) diff --git a/werewolf/roles/seer.py b/werewolf/roles/seer.py index b005b9a..5c58250 100644 --- a/werewolf/roles/seer.py +++ b/werewolf/roles/seer.py @@ -16,7 +16,6 @@ class Seer(Role): description = "A mystic in search of answers in a chaotic town.\n" \ "Calls upon the cosmos to discern those of Lycan blood" - def __init__(self, game): super().__init__(game) # self.game = game diff --git a/werewolf/werewolf.py b/werewolf/werewolf.py index b53b463..3aee698 100644 --- a/werewolf/werewolf.py +++ b/werewolf/werewolf.py @@ -1,12 +1,11 @@ import discord from discord.ext import commands from redbot.core import Config, checks, RedContext - from redbot.core.bot import Red +from redbot.core.utils.menus import menu, DEFAULT_CONTROLS from werewolf.builder import GameBuilder, role_from_name, role_from_alignment, role_from_category, role_from_id from werewolf.game import Game -from redbot.core.utils.menus import menu, DEFAULT_CONTROLS class Werewolf: @@ -74,7 +73,7 @@ class Werewolf: @commands.guild_only() @wwset.command(name="role") - async def wwset_role(self, ctx: RedContext, role: discord.Role=None): + async def wwset_role(self, ctx: RedContext, role: discord.Role = None): """ Assign the game role This role should not be manually assigned @@ -105,7 +104,7 @@ class Werewolf: @commands.guild_only() @wwset.command(name="channel") - async def wwset_channel(self, ctx: RedContext, channel: discord.TextChannel=None): + async def wwset_channel(self, ctx: RedContext, channel: discord.TextChannel = None): """ Assign the village channel """ @@ -118,7 +117,7 @@ class Werewolf: @commands.guild_only() @wwset.command(name="logchannel") - async def wwset_log_channel(self, ctx: RedContext, channel: discord.TextChannel=None): + async def wwset_log_channel(self, ctx: RedContext, channel: discord.TextChannel = None): """ Assign the log channel """ @@ -388,4 +387,3 @@ class Werewolf: return False, None, None, None, None return True, role, category, channel, log_channel -