try removing type on sd
All checks were successful
Build and push / changes (push) Successful in 25s
Build and push / Lint-Python (push) Successful in 2s
Build and push / Build-and-Push-Docker (push) Successful in 20s
Build and push / sync-argocd-app (push) Successful in 2s
Build and push / post-status-to-discord (push) Successful in 2s
All checks were successful
Build and push / changes (push) Successful in 25s
Build and push / Lint-Python (push) Successful in 2s
Build and push / Build-and-Push-Docker (push) Successful in 20s
Build and push / sync-argocd-app (push) Successful in 2s
Build and push / post-status-to-discord (push) Successful in 2s
This commit is contained in:
parent
893a4e4adb
commit
c8bf963836
@ -5,11 +5,7 @@ import datetime
|
||||
|
||||
def get_player(player):
|
||||
player = player.lower()
|
||||
url = (
|
||||
"https://api.gametools.network/bf2042/stats/?raw=false&format_values=true&name="
|
||||
+ player
|
||||
+ "&platform=pc&skip_battlelog=false"
|
||||
)
|
||||
url = f"https://api.gametools.network/bf2042/stats/?raw=false&format_values=true&name={player}&platform=pc&skip_battlelog=false"
|
||||
headers = {
|
||||
"User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64)",
|
||||
"accept": "application/json",
|
||||
|
@ -23,45 +23,45 @@ class Games(commands.Cog):
|
||||
|
||||
return worlds
|
||||
|
||||
@commands.slash_command(
|
||||
guild_ids=None,
|
||||
name="ffxiv",
|
||||
description="Query the game's API for data about a player",
|
||||
)
|
||||
@option(
|
||||
"player_name", description="Your player's first and last name", required=True
|
||||
)
|
||||
async def ffxiv(
|
||||
self,
|
||||
ctx: discord.ApplicationContext,
|
||||
player_name: str,
|
||||
server: discord.Option(
|
||||
str, autocomplete=discord.utils.basic_autocomplete(get_ffxiv_worlds)
|
||||
),
|
||||
):
|
||||
import ffxiv
|
||||
# @commands.slash_command(
|
||||
# guild_ids=None,
|
||||
# name="ffxiv",
|
||||
# description="Query the game's API for data about a player",
|
||||
# )
|
||||
# @option(
|
||||
# "player_name", description="Your player's first and last name", required=True
|
||||
# )
|
||||
# async def ffxiv(
|
||||
# self,
|
||||
# ctx: discord.ApplicationContext,
|
||||
# player_name: str,
|
||||
# server: discord.Option(
|
||||
# str, autocomplete=discord.utils.basic_autocomplete(get_ffxiv_worlds)
|
||||
# ),
|
||||
# ):
|
||||
# import ffxiv
|
||||
|
||||
try:
|
||||
embed = ffxiv.make_request(name=player_name.lower(), server=server.lower())
|
||||
await ctx.defer()
|
||||
await ctx.send_followup(embed=embed)
|
||||
except Exception:
|
||||
await ctx.send(
|
||||
"I encountered an error while searching for that player.\nPlease check that your player name and server are spelled correctly"
|
||||
)
|
||||
# try:
|
||||
# embed = ffxiv.make_request(name=player_name.lower(), server=server.lower())
|
||||
# await ctx.defer()
|
||||
# await ctx.send_followup(embed=embed)
|
||||
# except Exception:
|
||||
# await ctx.send(
|
||||
# "I encountered an error while searching for that player.\nPlease check that your player name and server are spelled correctly"
|
||||
# )
|
||||
|
||||
@commands.slash_command(
|
||||
guild_ids=None,
|
||||
name="2042",
|
||||
description="Query Battlefield 2042's API for data about a player",
|
||||
)
|
||||
@option("player_name", description="Your Origin/EA account name", required=True)
|
||||
async def battlefield(self, ctx: discord.ApplicationContext, player_name: str):
|
||||
import battlefield
|
||||
# @commands.slash_command(
|
||||
# guild_ids=None,
|
||||
# name="2042",
|
||||
# description="Query Battlefield 2042's API for data about a player",
|
||||
# )
|
||||
# @option("player_name", description="Your Origin/EA account name", required=True)
|
||||
# async def battlefield(self, ctx: discord.ApplicationContext, player_name: str):
|
||||
# import battlefield
|
||||
|
||||
await ctx.defer()
|
||||
embed = battlefield.get_player(player=player_name.lower())
|
||||
await ctx.send_followup(embed=embed)
|
||||
# await ctx.defer()
|
||||
# embed = battlefield.get_player(player=player_name.lower())
|
||||
# await ctx.send_followup(embed=embed)
|
||||
|
||||
|
||||
def setup(bot):
|
||||
|
@ -18,7 +18,6 @@ class StableDiffusion(commands.Cog):
|
||||
@option(
|
||||
"positive_prompt",
|
||||
description="The positive prompt to pass to stable diffusion",
|
||||
input_type="str",
|
||||
requred=True,
|
||||
)
|
||||
@option(
|
||||
|
Loading…
x
Reference in New Issue
Block a user