Skip to content

Commit

Permalink
Fortnite + Xbox fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Rarmash committed Jun 15, 2024
2 parents 17c79ca + 5f80b58 commit da4b58e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# R4Bot ![Version](https://img.shields.io/badge/Latest-1.1.3/master-blue.svg)
# R4Bot ![Version](https://img.shields.io/badge/Latest-1.1.4/master-blue.svg)
Discord-бот, созданный для облегчения модерации серверов, и не только. Используются слэш-команды.

## 🛠️ Установка
Expand Down
8 changes: 4 additions & 4 deletions gears/fortnite.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ async def stats(self, ctx: discord.ApplicationContext, username=None):
await ctx.defer()

# Get the Fortnite username for the player
username = self.get_fortnite_username(ctx, username)
username = get_fortnite_username(ctx, username)
# Check if the Fortnite username is available
if not username:
await ctx.respond(
Expand All @@ -52,7 +52,7 @@ async def stats(self, ctx: discord.ApplicationContext, username=None):
return

# Make a request to the Fortnite API for the stats data
stats_data, status = self.fortnite_api_request(username)
stats_data, status = fortnite_api_request(username)

# Handle different status codes
if status == 403:
Expand Down Expand Up @@ -94,7 +94,7 @@ async def stats(self, ctx: discord.ApplicationContext, username=None):
try:
embed.add_field(name="Владелец профиля",
value=f"<@{search_record_id(str(ctx.guild.id), "Users", "fortnite", username)}>")
except TypeError:
except IndexError:
pass
await ctx.respond(embed=embed)
except KeyError:
Expand Down Expand Up @@ -128,7 +128,7 @@ async def connect(self, ctx: discord.ApplicationContext, username):
await ctx.defer()
author_id = str(ctx.author.id)

stats_data, status = self.fortnite_api_request(username)
stats_data, status = fortnite_api_request(username)
if status != 200 or not stats_data:
await ctx.respond(f"При добавлении возникла ошибка **{status}**.\nВозможно, вы неверно указали никнейм.")
return
Expand Down
3 changes: 1 addition & 2 deletions gears/xbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ def __init__(self, bot):

@xbox.command(description='Посмотреть статистику по пользователю')
async def stats(self, ctx: discord.ApplicationContext, gamertag=None):
user_record = get_from_record(str(ctx.guild.id), "Users", str(ctx.author.id))
await ctx.defer()
gamertag = get_xbox_gamertag(ctx, gamertag)
if not gamertag:
Expand Down Expand Up @@ -69,7 +68,7 @@ async def stats(self, ctx: discord.ApplicationContext, gamertag=None):
value=f"[Тык](https://account.xbox.com/ru-ru/Profile?Gamertag={str(gamer_info.gamertag).replace(' ', '%20')})")
try:
embed.add_field(name="Владелец профиля", value=f"<@{search_record_id(str(ctx.guild.id), "Users", "xbox", gamertag)}>")
except TypeError:
except IndexError:
pass
if gamer_info.isXbox360Gamerpic:
embed.set_thumbnail(
Expand Down
2 changes: 1 addition & 1 deletion options.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Load environment variables from .env file
load_dotenv()

version = "1.1.3"
version = "1.1.4"

# Get environment variables
token = environ.get('TOKEN')
Expand Down

0 comments on commit da4b58e

Please sign in to comment.