Skip to content

Commit 944d7ea

Browse files
author
SleeplessOne1917
committed
Last minute pre publish cleanup
1 parent 60e4bca commit 944d7ea

File tree

3 files changed

+0
-48
lines changed

3 files changed

+0
-48
lines changed

src/bot.ts

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import {
2929
BotHandlerOptions,
3030
BotInstanceFederationOptions,
3131
BotOptions,
32-
SearchOptions,
3332
Vote,
3433
BotCredentials,
3534
InternalHandlers,
@@ -1180,47 +1179,6 @@ class LemmyBot {
11801179
}
11811180
}
11821181

1183-
async #getId(form: SearchOptions | string, type: 'Users' | 'Communities') {
1184-
let localOptions: SearchOptions;
1185-
if (typeof form === 'string') {
1186-
localOptions = {
1187-
name: form,
1188-
instance: this.#instance
1189-
};
1190-
} else {
1191-
localOptions = form;
1192-
}
1193-
const instanceWithoutPort = stripPort(localOptions.instance);
1194-
1195-
const { communities, users } = await this.__httpClient__.search({
1196-
q: localOptions.name,
1197-
type_: type
1198-
});
1199-
1200-
if (type === 'Communities') {
1201-
return communities.find(({ community: { name, title, actor_id } }) => {
1202-
let extractedInstance = '';
1203-
try {
1204-
extractedInstance = extractInstanceFromActorId(actor_id);
1205-
} catch {
1206-
console.log(
1207-
`Could not find !${localOptions.name}@${localOptions.instance}`
1208-
);
1209-
}
1210-
return (
1211-
(name === localOptions.name || title === localOptions.name) &&
1212-
extractedInstance === instanceWithoutPort
1213-
);
1214-
})?.community.id;
1215-
} else {
1216-
return users.find(
1217-
({ person: { name, display_name, actor_id } }) =>
1218-
(name === localOptions.name || display_name === localOptions.name) &&
1219-
extractInstanceFromActorId(actor_id) === instanceWithoutPort
1220-
)?.person.id;
1221-
}
1222-
}
1223-
12241182
#getModlogItems = (type: ModlogActionType) =>
12251183
this.__httpClient__.getModlog({
12261184
type_: type,

src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ export {
99
BotInstanceFederationOptions,
1010
BotInstanceList,
1111
BotOptions,
12-
SearchOptions,
1312
Vote
1413
} from './types';
1514

src/types.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,3 @@ export type BotCredentials = {
355355
username: string;
356356
password: string;
357357
};
358-
359-
export type SearchOptions = {
360-
name: string;
361-
instance: string;
362-
};

0 commit comments

Comments
 (0)