aboutsummaryrefslogtreecommitdiff
path: root/src/commands/info/icon.ts
blob: ce27cc0fed5ce98a95a593db22b90484534a8d81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { MessageEmbed } from 'discord.js';
import { BushCommand, BushMessage, BushSlashMessage } from '../../lib';

export default class IconCommand extends BushCommand {
	constructor() {
		super('icon', {
			aliases: ['icon', 'guildavatar', 'severicon', 'guildicon'],
			category: 'info',
			description: {
				content: "A command to get the server's icon",
				usage: 'icon',
				examples: 'icon'
			},
			clientPermissions: (m) => util.clientSendAndPermCheck(m, ['EMBED_LINKS'], true),
			userPermissions: [],
			channel: 'guild',
			slash: true
		});
	}

	override async exec(message: BushMessage | BushSlashMessage): Promise<void> {
		const embed = new MessageEmbed()
			.setTimestamp()
			.setColor(util.colors.default)
			.setImage(
				message.guild!.iconURL({
					size: 2048,
					dynamic: true,
					format: 'png'
				})!
			)
			.setTitle(message.guild!.name);
		await message.util.reply({ embeds: [embed] });
	}
}