Skip to content

Commit

Permalink
"node short url removed"
Browse files Browse the repository at this point in the history
  • Loading branch information
Josee9988 committed Jun 20, 2021
1 parent 0c320a5 commit 53941ff
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/commands/commands-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ import {IDimg} from "../db/dimg-interface";
import {helpCommand, infoCommand, pingCommand, pongCommand, unknownCommand} from "./informational-commands";
import checkIfUserIsAdmin from "./checkIfUserIsAdmin";

const shortUrl = require('node-url-shortener');


export default class CommandsController {
private cronJob: CronJob;

Expand Down Expand Up @@ -158,14 +155,6 @@ export default class CommandsController {
.send(photos[randomPhoto].url).catch((e: any) => console.error(`Couldn't send photo ${photos[randomPhoto]} with url ${photos[randomPhoto].url}.\nE: ${e}`));
await this.client.channels.cache.get(dimg.channelId)
.send(`${sendRandomPhotoMessage.msg2}**${new Date(photos[randomPhoto].imageUpdateDate).toLocaleDateString()}**`);

// send the shortened url, and if not, just send the non shortened url
let shortenedUrl = photos[randomPhoto].url;
shortUrl.short(shortenedUrl, async (_err: any, receivedShortenedUrl: any) => {
if (receivedShortenedUrl) shortenedUrl = receivedShortenedUrl;
await this.client.channels.cache.get(dimg.channelId)
.send(`Check it out at: *${shortenedUrl}*`);
});
}
}
}

0 comments on commit 53941ff

Please sign in to comment.