mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-14 08:08:34 +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 SubredditCommandBase = require('../../structures/commands/Subreddit');
|
||||||
const { MessageEmbed } = require('discord.js');
|
const { MessageEmbed } = require('discord.js');
|
||||||
const { formatNumber } = require('../../util/Util');
|
const { shorten, formatNumber } = require('../../util/Util');
|
||||||
|
|
||||||
module.exports = class SubredditCommand extends SubredditCommandBase {
|
module.exports = class SubredditCommand extends SubredditCommandBase {
|
||||||
constructor(client) {
|
constructor(client) {
|
||||||
@@ -28,7 +28,7 @@ module.exports = class SubredditCommand extends SubredditCommandBase {
|
|||||||
const embed = new MessageEmbed()
|
const embed = new MessageEmbed()
|
||||||
.setColor(0xFF4500)
|
.setColor(0xFF4500)
|
||||||
.setAuthor(`r/${subreddit}`, icon, `https://www.reddit.com/r/${subreddit}/`)
|
.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)
|
.setImage(post.post_hint === 'image' ? post.url : null)
|
||||||
.setURL(`https://www.reddit.com${post.permalink}`)
|
.setURL(`https://www.reddit.com${post.permalink}`)
|
||||||
.setTimestamp(post.created_utc * 1000)
|
.setTimestamp(post.created_utc * 1000)
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiao",
|
"name": "xiao",
|
||||||
"version": "112.15.2",
|
"version": "112.15.3",
|
||||||
"description": "Your personal server companion.",
|
"description": "Your personal server companion.",
|
||||||
"main": "Xiao.js",
|
"main": "Xiao.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user