Skip to content

Commit

Permalink
IMAGES
Browse files Browse the repository at this point in the history
  • Loading branch information
ThePhoDit committed Jul 19, 2020
1 parent 6965203 commit cd14e16
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/commands/reply.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ export default new Command('reply', async (caller, cmd, userDB) => {
const userEmbed = new MessageEmbed()
.setAuthor(`${cmd.msg.author.username}#${cmd.msg.author.discriminator}`, cmd.msg.author.dynamicAvatarURL())
.setColor(COLORS.RED)
.setDescription(cmd.args.join(' '))
.setDescription(cmd.args.join(' ') || 'No content provided.')
.setTimestamp();
if (files.length > 0) userEmbed.addField('Files', `This message contains ${files.length} file${files.length > 1 ? 's' : ''}`);
const channelEmbed = new MessageEmbed()
.setAuthor(`${cmd.msg.author.username}#${cmd.msg.author.discriminator}`, cmd.msg.author.dynamicAvatarURL())
.setColor(COLORS.GREEN)
.setDescription(cmd.args.join(' '))
.setDescription(cmd.args.join(' ') || 'No content provided.')
.setTimestamp();

caller.utils.discord.createMessage(cmd.channel.id, { embed: channelEmbed.code }, false, files);
Expand Down
6 changes: 4 additions & 2 deletions src/events/messageCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ export default async (caller: Caller, msg: Message): Promise<unknown> => {
const guildEmbed = new MessageEmbed()
.setAuthor(`${msg.author.username}#${msg.author.discriminator}`, msg.author.dynamicAvatarURL())
.setColor(COLORS.RED)
.setDescription(msg.content)
.setDescription(msg.content || 'No content provided.')
.setTimestamp();
if (files.length > 0) guildEmbed.addField('Files', `This message contains ${files.length} file${files.length > 1 ? 's' : ''}`);

caller.utils.discord.createMessage(channel.id, {embed: guildEmbed.code}, false, files);
}
Expand Down Expand Up @@ -63,10 +64,11 @@ export default async (caller: Caller, msg: Message): Promise<unknown> => {
.setTitle(config.messages.open_notification || 'New Thread')
.setThumbnail(msg.author.dynamicAvatarURL())
.setColor(COLORS.BLUE)
.setDescription(msg.content)
.setDescription(msg.content || 'No content provided.')
.addField('User', `${msg.author.username}#${msg.author.discriminator} \`[${msg.author.id}]\``)
.addField('Past Threads', userDB.total.toString())
.setTimestamp();
if (files.length > 0) guildOpenEmbed.addField('Files', `This message contains ${files.length} file${files.length > 1 ? 's' : ''}`);

caller.utils.discord.createMessage(msg.author.id, { embed: userOpenEmbed.code }, true);
(channel as TextChannel).createMessage({ content: config.role_ping ? `<@&${config.role_ping}>` : '', embed: guildOpenEmbed.code }, files);
Expand Down

0 comments on commit cd14e16

Please sign in to comment.