switch to log
This commit is contained in:
parent
98ae481d14
commit
84ed2728e7
@ -203,8 +203,7 @@ class Game:
|
|||||||
reason="(BOT) New game of werewolf",
|
reason="(BOT) New game of werewolf",
|
||||||
)
|
)
|
||||||
except discord.Forbidden as e:
|
except discord.Forbidden as e:
|
||||||
print("Unable to rename Game Channel")
|
log.exception("Unable to rename Game Channel")
|
||||||
print(e)
|
|
||||||
await ctx.send("Unable to rename Game Channel, ignoring")
|
await ctx.send("Unable to rename Game Channel, ignoring")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -222,11 +221,11 @@ class Game:
|
|||||||
return
|
return
|
||||||
self.started = True
|
self.started = True
|
||||||
# Assuming everything worked so far
|
# Assuming everything worked so far
|
||||||
print("Pre at_game_start")
|
log.debug("Pre at_game_start")
|
||||||
await self._at_game_start() # This will queue channels and votegroups to be made
|
await self._at_game_start() # This will queue channels and votegroups to be made
|
||||||
print("Post at_game_start")
|
log.debug("Post at_game_start")
|
||||||
for channel_id in self.p_channels:
|
for channel_id in self.p_channels:
|
||||||
print("Channel id: " + channel_id)
|
log.debug("Setup Channel id: " + channel_id)
|
||||||
overwrite = {
|
overwrite = {
|
||||||
self.guild.default_role: discord.PermissionOverwrite(read_messages=False),
|
self.guild.default_role: discord.PermissionOverwrite(read_messages=False),
|
||||||
self.guild.me: discord.PermissionOverwrite(
|
self.guild.me: discord.PermissionOverwrite(
|
||||||
@ -258,7 +257,7 @@ class Game:
|
|||||||
|
|
||||||
self.vote_groups[channel_id] = vote_group
|
self.vote_groups[channel_id] = vote_group
|
||||||
|
|
||||||
print("Pre-cycle")
|
log.debug("Pre-cycle")
|
||||||
await asyncio.sleep(1)
|
await asyncio.sleep(1)
|
||||||
await asyncio.ensure_future(self._cycle()) # Start the loop
|
await asyncio.ensure_future(self._cycle()) # Start the loop
|
||||||
|
|
||||||
@ -566,7 +565,8 @@ class Game:
|
|||||||
await member.add_roles(*[self.game_role])
|
await member.add_roles(*[self.game_role])
|
||||||
except discord.Forbidden:
|
except discord.Forbidden:
|
||||||
await channel.send(
|
await channel.send(
|
||||||
f"Unable to add role **{self.game_role.name}**\nBot is missing `manage_roles` permissions"
|
f"Unable to add role **{self.game_role.name}**\n"
|
||||||
|
f"Bot is missing `manage_roles` permissions"
|
||||||
)
|
)
|
||||||
|
|
||||||
await channel.send(
|
await channel.send(
|
||||||
@ -899,7 +899,7 @@ class Game:
|
|||||||
# Remove game_role access for potential archiving for now
|
# Remove game_role access for potential archiving for now
|
||||||
reason = "(BOT) End of WW game"
|
reason = "(BOT) End of WW game"
|
||||||
for obj in self.to_delete:
|
for obj in self.to_delete:
|
||||||
print(obj)
|
log.debug(f"End_game: Deleting object {obj}")
|
||||||
await obj.delete(reason=reason)
|
await obj.delete(reason=reason)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -129,7 +129,7 @@ class Role(WolfListener):
|
|||||||
return "Default"
|
return "Default"
|
||||||
|
|
||||||
@wolflistener("at_game_start", priority=1)
|
@wolflistener("at_game_start", priority=1)
|
||||||
async def _at_game_start(self, data=None):
|
async def _at_game_start(self):
|
||||||
if self.channel_id:
|
if self.channel_id:
|
||||||
await self.game.register_channel(self.channel_id, self)
|
await self.game.register_channel(self.channel_id, self)
|
||||||
|
|
||||||
|
@ -57,9 +57,9 @@ class VanillaWerewolf(Role):
|
|||||||
return "Werewolf"
|
return "Werewolf"
|
||||||
|
|
||||||
@wolflistener("at_game_start")
|
@wolflistener("at_game_start")
|
||||||
async def _at_game_start(self, data=None):
|
async def _at_game_start(self):
|
||||||
if self.channel_id:
|
if self.channel_id:
|
||||||
print("Wolf has channel_id: " + self.channel_id)
|
log.debug("Wolf has channel_id: " + self.channel_id)
|
||||||
await self.game.register_channel(
|
await self.game.register_channel(
|
||||||
self.channel_id, self, WolfVote
|
self.channel_id, self, WolfVote
|
||||||
) # Add VoteGroup WolfVote
|
) # Add VoteGroup WolfVote
|
||||||
|
@ -47,7 +47,7 @@ class Werewolf(Cog):
|
|||||||
return
|
return
|
||||||
|
|
||||||
def __unload(self):
|
def __unload(self):
|
||||||
print("Unload called")
|
log.debug("Unload called")
|
||||||
for game in self.games.values():
|
for game in self.games.values():
|
||||||
del game
|
del game
|
||||||
|
|
||||||
@ -182,7 +182,7 @@ class Werewolf(Cog):
|
|||||||
Joins a game of Werewolf
|
Joins a game of Werewolf
|
||||||
"""
|
"""
|
||||||
|
|
||||||
game = await self._get_game(ctx)
|
game: Game = await self._get_game(ctx)
|
||||||
|
|
||||||
if not game:
|
if not game:
|
||||||
await ctx.send("No game to join!\nCreate a new one with `[p]ww new`")
|
await ctx.send("No game to join!\nCreate a new one with `[p]ww new`")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user