message: Make function async
diff: @@ -452,7 +452,9 @@ function setBotOptions(event: MessageEvent<any>, roomId: string, userId: string)
  });
  }
  -function setBotPower(event: MessageEvent<any>, roomId: string, userId: string, level: number, ignoreIfGreater?: boolean): void {
  +async function setBotPower(
  + event: MessageEvent<any>, roomId: string, userId: string, level: number, ignoreIfGreater?: boolean,
  +): Promise<void> {
  if (!(Number.isInteger(level) && level >= 0)) {
  sendError(event, _t('Power level must be positive integer.'));
  return;
  @@ -465,34 +467,34 @@ function setBotPower(event: MessageEvent<any>, roomId: string, userId: string, l
  return;
  }
  - client.getStateEvent(roomId, "m.room.power_levels", "").then((powerLevels) => {
  - const powerEvent = new MatrixEvent(
  - {
  - type: "m.room.power_levels",
  - content: powerLevels,
  - },
  - );
  + try {
  + const powerLevels = await client.getStateEvent(roomId, "m.room.power_levels", "");
  // If the PL is equal to or greater than the requested PL, ignore.
  - if (ignoreIfGreater) {
  + if (ignoreIfGreater === true) {
  // As per https://matrix.org/docs/spec/client_server/r0.6.0#m-room-power-levels
  - const currentPl = (powerLevels.content.users && powerLevels.content.users[userId]) || powerLevels.content.users_default || 0;
  + const currentPl = (
  + powerLevels.content.users && powerLevels.content.users[userId]
  + ) || powerLevels.content.users_default || 0;
  if (currentPl >= level) {
  - sendResponse(event, {
  + return sendResponse(event, {
  success: true,
  });
  }
  }
  -
  - client.setPowerLevel(roomId, userId, level, powerEvent).then(() => {
  - sendResponse(event, {
  + await client.setPowerLevel(roomId, userId, level, new MatrixEvent(
  + {
  + type: "m.room.power_levels",
  + content: powerLevels,
  + },
  + ));
  + return sendResponse(event, {
  success: true,
  });
  - }, (err) => {
  + } catch (err) {
  sendError(event, err.message ? err.message : _t('Failed to send request.'), err);
  - });
  - });
  + }
  }
  function getMembershipState(event: MessageEvent<any>, roomId: string, userId: string): void {
  