mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Fix Subreddit post titles being above 256 chars
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
const SubredditCommandBase = require('../../structures/commands/Subreddit');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { formatNumber } = require('../../util/Util');
|
||||
const { shorten, formatNumber } = require('../../util/Util');
|
||||
|
||||
module.exports = class SubredditCommand extends SubredditCommandBase {
|
||||
constructor(client) {
|
||||
@@ -28,7 +28,7 @@ module.exports = class SubredditCommand extends SubredditCommandBase {
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0xFF4500)
|
||||
.setAuthor(`r/${subreddit}`, icon, `https://www.reddit.com/r/${subreddit}/`)
|
||||
.setTitle(post.title)
|
||||
.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)
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "112.15.2",
|
||||
"version": "112.15.3",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user