diff --git a/rustplus/api/remote/rustws.py b/rustplus/api/remote/rustws.py index d9d953f..c129818 100644 --- a/rustplus/api/remote/rustws.py +++ b/rustplus/api/remote/rustws.py @@ -214,9 +214,10 @@ async def run(self) -> None: try: # This creates an asyncio task rather than awaiting the coroutine directly. - # This fixes the bug where if you called a BaseRustSocket#get... from within a RegisteredListener or callback, - # It would hang the websocket. This is because the websocket event loop would be stuck on the callback rather than polling the socket. - # This way, we can schedule the execution of all logic for this message, but continue polling the WS + # This fixes the bug where if you called a BaseRustSocket#get... from within a RegisteredListener or + # callback, It would hang the websocket. This is because the websocket event loop would be stuck on the + # callback rather than polling the socket. This way, we can schedule the execution of all logic for this + # message, but continue polling the WS await self.run_coroutine_non_blocking(self.handle_message(app_message)) except Exception: self.logger.exception( diff --git a/rustplus/api/rust_api.py b/rustplus/api/rust_api.py index 69fc847..cec21d5 100644 --- a/rustplus/api/rust_api.py +++ b/rustplus/api/rust_api.py @@ -244,9 +244,7 @@ async def get_map( for marker in map_markers: if add_events: - if ( - marker.type in RustMarker.Events - ): + if marker.type in RustMarker.Events: icon = convert_marker(str(marker.type), marker.rotation) if marker.type == 6: x = marker.x diff --git a/rustplus/api/structures/rust_marker.py b/rustplus/api/structures/rust_marker.py index 8003de8..a7cef3e 100644 --- a/rustplus/api/structures/rust_marker.py +++ b/rustplus/api/structures/rust_marker.py @@ -94,7 +94,13 @@ class RustMarker(Serializable): RadiusMarker = 7 PatrolHelicopterMarker = 8 - Events = (ExplosionMarker, ChinookMarker, CargoShipMarker, CrateMarker, PatrolHelicopterMarker) + Events = ( + ExplosionMarker, + ChinookMarker, + CargoShipMarker, + CrateMarker, + PatrolHelicopterMarker, + ) def __init__(self, data: AppMarker) -> None: self._id: int = data.id diff --git a/rustplus/commands/command_handler.py b/rustplus/commands/command_handler.py index 47d5107..87a6961 100644 --- a/rustplus/commands/command_handler.py +++ b/rustplus/commands/command_handler.py @@ -23,7 +23,7 @@ def register_command(self, data: CommandData) -> None: async def run_command(self, message: RustChatMessage, prefix) -> None: if prefix == self.command_options.prefix: - command = shlex.split(message.message)[0][len(prefix) :] + command = shlex.split(message.message)[0][len(prefix):] else: command = prefix