diff options
| author | 8cy <[email protected]> | 2020-07-23 23:24:17 -0700 |
|---|---|---|
| committer | 8cy <[email protected]> | 2020-07-23 23:24:17 -0700 |
| commit | bb511abc03bb66848947e37a999502b813c77269 (patch) | |
| tree | 612c010fc8317e1cdf11471a18aad0270819d33e /src/commands/fun/subreddit.ts | |
| parent | fix: if clear amount equal or over 100, round down to 99 (diff) | |
| download | dep-core-bb511abc03bb66848947e37a999502b813c77269.tar.xz dep-core-bb511abc03bb66848947e37a999502b813c77269.zip | |
goodbye old uwufier :cry:
Diffstat (limited to 'src/commands/fun/subreddit.ts')
| -rw-r--r-- | src/commands/fun/subreddit.ts | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/src/commands/fun/subreddit.ts b/src/commands/fun/subreddit.ts deleted file mode 100644 index a9369d2..0000000 --- a/src/commands/fun/subreddit.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { Command, CommandoMessage } from 'discord.js-commando'; -import SubredditCommandBase from '../../models/commands/Subreddit.js' -import { shorten, formatNumber } from '../../utils/Util.js' -import { MessageEmbed } from 'discord.js'; - -module.exports = class SubredditFun extends SubredditCommandBase { - constructor(client) { - super(client, { - name: 'subreddit', - aliases: ['r/', 'sub', 'reddit'], - patterns: [/^r\/(.+)/i], - group: 'fun', - memberName: 'subreddit', - description: 'Replies with a random post from a specified subreddit.', - args: [ - { - key: 'sSub', - prompt: 'Which subreddit would you like to get a post from?', - type: 'string', - parse: subreddit => encodeURIComponent(subreddit) - } - ], - examples: ['uwu!say hi'], - throttling: { - usages: 5, - duration: 30 - }, - userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'], - clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'] - }); - } - generateText(post, subreddit, icon) { - const embed = new MessageEmbed() - .setColor(0xFFCC4D) - .setAuthor(`r/${subreddit}`, icon, `https://www.reddit.com/r/${subreddit}/`) - .setTitle(shorten(post.title, 256)) - .setImage(post.post_hint === 'image' ? post.url : null) - .setURL(`https://www.reddit.com${post.permalink}`) - .setTimestamp(post.created_utc * 1000) - .setFooter(`⬆ ${formatNumber(post.score)}`); - if (post.thumbnail && post.thumbnail !== 'self' && post.post_hint !== 'image') { - embed.setThumbnail(post.thumbnail); - } - return embed; - } -};
\ No newline at end of file |