mirror of
https://github.com/the-draupnir-project/Draupnir.git
synced 2026-06-03 22:31:17 +00:00
Make sure we catch the 404
This commit is contained in:
@@ -107,12 +107,21 @@ export class MjolnirAppService {
|
||||
dataStore,
|
||||
prometheus
|
||||
);
|
||||
const ownProfile = await appService.bridge.getBot().getClient().getUserProfile(await appService.bridge.getBot().getClient().getUserId()) as {
|
||||
avatar_url?: string,
|
||||
displayname?: string
|
||||
} | undefined;
|
||||
if (ownProfile && ownProfile.displayname !== "Draupnir Admin Bot") {
|
||||
appService.bridge.getBot().getClient().setDisplayName("Draupnir Admin Bot");
|
||||
try {
|
||||
const ownProfile = await appService.bridge.getBot().getClient().getUserProfile(await appService.bridge.getBot().getClient().getUserId()) as {
|
||||
avatar_url?: string,
|
||||
displayname?: string
|
||||
} | undefined;
|
||||
if (ownProfile && ownProfile.displayname !== "Draupnir Admin Bot") {
|
||||
try {
|
||||
await appService.bridge.getBot().getClient().setDisplayName("Draupnir Admin Bot");
|
||||
} catch (e: any) {
|
||||
log.error("Failed to set Displayname for Bot user");
|
||||
}
|
||||
}
|
||||
} catch (e: any) {
|
||||
log.info("No Profile found. Setting the defaults");
|
||||
await appService.bridge.getBot().getClient().setDisplayName("Draupnir Admin Bot");
|
||||
}
|
||||
bridge.opts.controller = {
|
||||
onUserQuery: appService.onUserQuery.bind(appService),
|
||||
|
||||
Reference in New Issue
Block a user