forked from c0de/BaseballBot
Use the with
statement on the game class
This is because the class is a context manager / state machine
This commit is contained in:
@@ -15,8 +15,8 @@ class GhostBallClient(discord.Client):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(GhostBallClient, self).__init__(*args, **kwargs)
|
||||
|
||||
self.game = game.Game()
|
||||
self.game.discord = self
|
||||
with game.Game() as self.game:
|
||||
self.game.discord = self
|
||||
|
||||
async def on_ready(self):
|
||||
print("Logged on as", self.user)
|
||||
|
Reference in New Issue
Block a user