Fix linting issues with client

This commit is contained in:
c0de 2022-10-24 20:22:04 -05:00
parent b154efb6cc
commit e0dc0e6b78

View File

@ -2,6 +2,16 @@
# Copyright 2022 - c0de <c0de@c0de.dev>
# Licensed under the MIT License (https://opensource.org/licenses/MIT)
# pylint: disable=wrong-import-position
"""
A discord bot that hosts Ghostball/Braveball.
A discord game where players guess the pitch speed
from a fantasy baseball pitcher, and whoever is
closer gets more points
"""
import sys
import discord
@ -12,16 +22,24 @@ import game
class GhostBallClient(discord.Client):
"""
Implementation of a Discord client that will monitor
a channel for messages, and if it recieves a message
defined in the Game object, and pass it along
"""
def __init__(self, *args, **kwargs):
super(GhostBallClient, self).__init__(*args, **kwargs)
super().__init__(*args, **kwargs)
with game.Game() as self.game:
self.game.discord = self
async def on_ready(self):
"""Method called when connected to Discord"""
print("Logged on as", self.user)
async def on_message(self, message):
"""Method called when a message is recieved"""
# Don't respond to ourself
if message.author == self.user:
return