Skip to content

Commit

Permalink
updated /docs command
Browse files Browse the repository at this point in the history
  • Loading branch information
GhomKrosmonaute committed Nov 3, 2024
1 parent 402a96a commit 7404359
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
15 changes: 11 additions & 4 deletions src/listeners/helping.info.threadCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,17 @@ const listener: app.Listener<"threadCreate"> = {
if (thread.parent.id !== guild.help_forum_channel_id) return

return thread.send(
await app.getSystemMessage("default", {
header: "Bienvenue sur le forum d'entraide",
body: "Vous pouvez poser vos questions ici, n'oubliez pas de donner le plus de détails possible pour que nous puissions vous aider au mieux.",
}),
await app
.getSystemMessage("default", {
header: "Bienvenue sur le forum d'entraide",
body: "Vous pouvez poser vos questions ici, n'oubliez pas de donner le plus de détails possible pour que nous puissions vous aider au mieux.",
})
.then((systemMessage) => {
;(systemMessage.embeds![0] as app.EmbedBuilder).setURL(
app.HELPING_URL_AS_ID,
)
return systemMessage
}),
)
},
}
Expand Down
3 changes: 2 additions & 1 deletion src/namespaces/openai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ export async function generateDocURLList(tags: string): Promise<string> {
The list must be in markdown and as long as you want.
La liste ne doit pas être trop longue, elle doit être lisible dans un message Discord.
Each returned link must be on a new line and wrapped in <>. Example: <https://example.com>
Please make sure than the links exist! No fake links!
Tu dois aussi ranger les liens par ordre d'importance et les grouper par tag relatif. Exemple:
### Tag 1
- <https://example.com>
Expand Down Expand Up @@ -168,7 +169,7 @@ export async function generateDocURLList(tags: string): Promise<string> {
},
],
max_tokens: 1500,
model: "gpt-3.5-turbo",
model: "chatgpt-4o-latest",
})

const list = response.choices[0].message.content
Expand Down
6 changes: 4 additions & 2 deletions src/namespaces/point.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import upTopic from "#buttons/upTopic.ts"
import givePoints from "#buttons/givePoints.ts"
import resolveTopic from "#buttons/resolveTopic.ts"

export const HELPING_URL_AS_ID = "https://helping.fr"

export interface PointLadderLine {
target: string
score: number
Expand Down Expand Up @@ -95,7 +97,7 @@ export function buildHelpingFooterEmbed(
return {
embeds: [
new app.EmbedBuilder()
.setURL("https://helping.fr/")
.setURL(HELPING_URL_AS_ID)
.setDescription(
`### ${
topicState?.resolved
Expand Down Expand Up @@ -158,7 +160,7 @@ export async function refreshHelpingFooter(topic: app.ThreadChannel) {
m.author.id === topic.client.user.id &&
!m.system &&
m.embeds.length > 0 &&
m.embeds[0].url?.includes("helping"),
m.embeds[0].url?.startsWith(HELPING_URL_AS_ID),
)
.slice(0, 3)

Expand Down

0 comments on commit 7404359

Please sign in to comment.