Skip to content

Commit

Permalink
Formatting Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
olijeffers0n committed May 22, 2024
1 parent 6628bee commit d52d865
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
14 changes: 7 additions & 7 deletions rustplus/api/base_rust_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,20 +321,20 @@ def command(
self.remote.command_handler.register_command(cmd_data)
return RegisteredListener(coro.__name__, cmd_data.coro)

def wrap_func(coro):
def wrap_func(coroutine: Union[RegisteredListener, Coroutine]):
if self.command_options is None:
raise CommandsNotEnabledError("Not enabled")

if isinstance(coro, RegisteredListener):
coro = coro.get_coro()
if isinstance(coroutine, RegisteredListener):
coroutine = coroutine.get_coro()

cmd_data = CommandData(
coro,
command_data = CommandData(
coroutine,
aliases,
alias_func,
)
self.remote.command_handler.register_command(cmd_data)
return RegisteredListener(coro.__name__, cmd_data.coro)
self.remote.command_handler.register_command(command_data)
return RegisteredListener(coroutine.__name__, coroutine)

return wrap_func

Expand Down
12 changes: 2 additions & 10 deletions rustplus/api/rust_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,7 @@ async def get_map(
for marker in map_markers:
if add_events:
if (
marker.type == 2
or marker.type == 4
or marker.type == 5
or marker.type == 6
or marker.type == 8
marker.type in RustMarker.Events
):
icon = convert_marker(str(marker.type), marker.rotation)
if marker.type == 6:
Expand Down Expand Up @@ -364,11 +360,7 @@ async def get_current_events(self) -> List[RustMarker]:
return [
marker
for marker in (await self.get_markers())
if marker.type == 2
or marker.type == 4
or marker.type == 5
or marker.type == 6
or marker.type == 8
if marker.type in RustMarker.Events
]

async def get_contents(
Expand Down
2 changes: 2 additions & 0 deletions rustplus/api/structures/rust_marker.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ class RustMarker(Serializable):
RadiusMarker = 7
PatrolHelicopterMarker = 8

Events = (ExplosionMarker, ChinookMarker, CargoShipMarker, CrateMarker, PatrolHelicopterMarker)

def __init__(self, data: AppMarker) -> None:
self._id: int = data.id
self._type: int = data.type
Expand Down

0 comments on commit d52d865

Please sign in to comment.