This repository has been archived by the owner on Jan 29, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feature/Add-Tests
- Loading branch information
Showing
6 changed files
with
84 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Qodana | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: # Specify your branches here | ||
- main # The 'main' branch | ||
- master # The 'master' branch | ||
- 'releases/*' # The release branches | ||
|
||
jobs: | ||
qodana: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
checks: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit | ||
fetch-depth: 0 # a full history is required for pull request analysis | ||
- name: 'Qodana Scan' | ||
uses: JetBrains/[email protected] | ||
env: | ||
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import {CommandInteraction, Client, ApplicationCommandOptionType} from "discord.js"; | ||
import {Command} from "../Handler/CommandList.ts"; | ||
import axios from "axios"; | ||
import {GetLodestoneCharacterId, GetLodestoneFreeCompany} from "../Helpers/LodestoneHelpers.ts"; | ||
|
||
export const GetCharacterId: Command = { | ||
name: "getcharacterid", | ||
description: "Primitively searches the Lodestone for a character and returns the character Id", | ||
options: [ | ||
{ | ||
name: "message", | ||
description: "Player in-game Username", | ||
type: ApplicationCommandOptionType.String, | ||
required: true | ||
} | ||
], | ||
// run function to execute the command | ||
run: async (client: Client, interaction: CommandInteraction) => { | ||
let messageContent = interaction.options.get("message")!.value as string; | ||
|
||
// Default to Carbuncle Server as we only need to query the FCs server location | ||
let server = "Carbuncle"; | ||
let content = ""; | ||
try { | ||
let [firstName, lastName] = messageContent.split(" "); | ||
|
||
if (!firstName && lastName) { | ||
content = "Unable to get entered FirstName and LastName"; | ||
} else { | ||
let characterId = await GetLodestoneCharacterId(firstName, lastName); | ||
if (characterId) { | ||
content = characterId; | ||
} else { | ||
content = "Unable to get Character Id"; | ||
} | ||
} | ||
} catch (err) { | ||
console.error("Error:", err); | ||
content = `Error: ${err}`; | ||
} | ||
|
||
await interaction.followUp({ | ||
ephemeral: true, | ||
content | ||
}); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters