Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

Commit

Permalink
Fixed naming inconsistencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lenny P Critchley committed Aug 29, 2020
1 parent 3b8ce7a commit d4458be
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
14 changes: 7 additions & 7 deletions discordsdk/achievement.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def _on_user_achievement_update(self, event_data, user_achievement):

def set_user_achievement(
self,
achievementId: int,
percentComplete: int,
achievement_id: int,
percent_complete: int,
callback: t.Callable[[Result], None]
) -> None:
"""
Expand All @@ -44,8 +44,8 @@ def c_callback(callback_data, result):

self._internal.set_user_achievement(
self._internal,
achievementId,
percentComplete,
achievement_id,
percent_complete,
ctypes.c_void_p(),
c_callback
)
Expand Down Expand Up @@ -84,19 +84,19 @@ def get_user_achievement_at(self, index: int) -> UserAchievement:
index,
achievement
))
if resuok != Result.ok:
if result != Result.ok:
raise get_exception(result)

return UserAchievement(internal=achievement)

def get_user_achievement(self, achievementId: int) -> None:
def get_user_achievement(self, achievement_id: int) -> None:
"""
Gets the user achievement for the given achievement id.
"""
achievement = sdk.DiscordUserAchievement()
result = Result(self._internal.get_user_achievement(
self._internal,
achievementId,
achievement_id,
achievement
))
if result != Result.ok:
Expand Down
20 changes: 10 additions & 10 deletions discordsdk/activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ def register_command(self, command: str) -> Result:
result = Result(self._internal.register_command(self._internal, command.encode("utf8")))
return result

def register_steam(self, steamId: int) -> Result:
def register_steam(self, steam_id: int) -> Result:
"""
Registers your game's Steam app id for the protocol `steam://run-game-id/<id>`.
"""
result = Result(self._internal.register_steam(self._internal, steamId))
result = Result(self._internal.register_steam(self._internal, steam_id))
return result

def update_activity(self, activity: Activity, callback: t.Callable[[Result], None]) -> None:
Expand Down Expand Up @@ -87,7 +87,7 @@ def c_callback(callback_data, result):

def send_request_reply(
self,
userId: int,
user_id: int,
reply: ActivityJoinRequestReply,
callback: t.Callable[[Result], None]
) -> None:
Expand All @@ -106,15 +106,15 @@ def c_callback(callback_data, result):

self._internal.send_request_reply(
self._internal,
userId,
user_id,
reply,
ctypes.c_void_p(),
c_callback
)

def send_invite(
self,
userId: int,
user_id: int,
type: ActivityActionType,
content: str,
callback: t.Callable[[Result], None]
Expand All @@ -134,14 +134,14 @@ def c_callback(callback_data, result):

self._internal.send_invite(
self._internal,
userId,
user_id,
type,
content.encode("utf8"),
ctypes.c_void_p(),
c_callback
)

def accept_invite(self, userId: int, callback: t.Callable[[Result], None]) -> None:
def accept_invite(self, user_id: int, callback: t.Callable[[Result], None]) -> None:
"""
Accepts a game invitation from a given userId.
Expand All @@ -155,14 +155,14 @@ def c_callback(callback_data, result):
c_callback = self._internal.accept_invite.argtypes[-1](c_callback)
self._garbage.append(c_callback) # prevent it from being garbage collected

self._internal.accept_invite(self._internal, userId, ctypes.c_void_p(), c_callback)
self._internal.accept_invite(self._internal, user_id, ctypes.c_void_p(), c_callback)

def on_activity_join(self, joinSecret: str) -> None:
def on_activity_join(self, join_secret: str) -> None:
"""
Fires when a user accepts a game chat invite or receives confirmation from Asking to Join.
"""

def on_activity_spectate(self, spectateSecret: str) -> None:
def on_activity_spectate(self, spectate_secret: str) -> None:
"""
Fires when a user accepts a spectate chat invite or clicks the Spectate button on a user's
profile.
Expand Down

0 comments on commit d4458be

Please sign in to comment.