Skip to content

Commit

Permalink
Merge branch 'AkaruiDevelopment:v6' into v6
Browse files Browse the repository at this point in the history
  • Loading branch information
Faf4a authored Dec 10, 2023
2 parents 90ad9ed + 760434a commit c1db39e
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 10 deletions.
15 changes: 15 additions & 0 deletions src/functions/user/referenceUserId.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = async (d) => {
const data = d.util.aoiFunc(d);
const [messageID = d.message.id] = data.inside.splits;

const message = messageID ? await d.channel.messages.fetch(messageID) : d.message;
if (!message) return d.aoiError.fnError(d, 'message', { inside: data.inside });

const id = message.reference?.messageId;

data.result = id ? (await d.channel.messages.fetch(id))?.author.id : '';

return {
code: d.util.setCode(data),
}
}
10 changes: 5 additions & 5 deletions src/functions/util/stringEndsWith.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ module.exports = async d => {
const data = d.util.aoiFunc(d);
if (data.err) return d.error(data.err);

const [text, check] = data.inside.splits;

data.result = text.addBrackets().endsWith(check.addBrackets());
const [text, ...checks] = data.inside.splits;
const result = checks.some(check => text.addBrackets().endsWith(check.addBrackets()));
data.result = result

return {
code: d.util.setCode(data)
code: d.util.setCode(data)
}
}
}
10 changes: 5 additions & 5 deletions src/functions/util/stringStartsWith.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ module.exports = async d => {
const data = d.util.aoiFunc(d);
if (data.err) return d.error(data.err);

const [text, check] = data.inside.splits;

data.result = text.addBrackets().startsWith(check.addBrackets());
const [text, ...checks] = data.inside.splits;
const result = checks.some(check => text.addBrackets().startsWith(check.addBrackets()));
data.result = result

return {
code: d.util.setCode(data)
code: d.util.setCode(data)
}
}
}
1 change: 1 addition & 0 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ declare module "aoi.js" {
constructor(options: ClientOptions);

status(d: StatusOption[]): void;
loadCommands(directory: string, debug?: boolean): void;
variables(data: object, table?: string): void;
}

Expand Down

0 comments on commit c1db39e

Please sign in to comment.