Skip to content

Commit

Permalink
Another bug
Browse files Browse the repository at this point in the history
  • Loading branch information
LunaUrsa committed Feb 26, 2024
1 parent 4a4678e commit 0b34509
Showing 2 changed files with 15 additions and 33 deletions.
18 changes: 14 additions & 4 deletions src/discord/utils/trust.ts
Original file line number Diff line number Diff line change
@@ -53,18 +53,28 @@ export async function addedVerified(
update: {},
});

const userData = await db.users.upsert({
where: {
discord_id: newMember.id,
},
create: {
discord_id: newMember.id,
},
update: {},
});

let memberData = {} as members;
try {
memberData = await db.members.upsert({
where: {
id_guild_id: {
guild_id: newMember.guild.id,
id: newMember.id,
guild_id: guildData.id,
id: userData.discord_id as string,
},
},
create: {
guild_id: newMember.guild.id,
id: newMember.id,
guild_id: guildData.id,
id: userData.discord_id as string,
},
update: {},
});
30 changes: 1 addition & 29 deletions src/global/commands/g.ai.ts
Original file line number Diff line number Diff line change
@@ -79,39 +79,11 @@ Any role with 'TS' lettering is an official TripSit team member role.
Patreon subscribers can use the /imagen command to generate images.
`;

// # Example dummy function hard coded to return the same weather
// # In production, this could be your backend API or an external API
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async function getCurrentWeather(location:string, unit = 'fahrenheit') {
return {
location,
temperature: '72',
unit,
forecast: ['sunny', 'windy'],
};
}

const availableFunctions = {
getCurrentWeather,
getDrugInfo,
};

const aiFunctions = [
{
type: 'function',
function: {
name: 'getCurrentWeather',
description: 'Get the weather in location',
parameters: {
type: 'object',
properties: {
location: { type: 'string', description: 'The city and state e.g. San Francisco, CA' },
unit: { type: 'string', enum: ['c', 'f'] },
},
required: ['location'],
},
},
},
{
type: 'function',
function: {
@@ -127,7 +99,7 @@ const aiFunctions = [
},
},
},
];
] as Assistant.Function[];

export async function aiModerateReport(
message: string,

0 comments on commit 0b34509

Please sign in to comment.