File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,9 @@ import {MessageEmbed, MessageEmbedOptions} from 'discord.js';
22
33type AnyObject = { [ k : string ] : any } ;
44
5- const templates : { [ k : string ] : MessageEmbedOptions } = {
5+ type Templates = { [ k in string | 'basic' | 'color' | 'complete' | 'image' ] : MessageEmbedOptions }
6+
7+ const templates : Templates = {
68 basic : {
79 footer : {
810 text : '${client.user.username}' ,
@@ -53,7 +55,7 @@ class BetterEmbed extends MessageEmbed {
5355 this . checkSize ( ) ;
5456 }
5557
56- public static fromTemplate ( template : keyof typeof templates | typeof templates | MessageEmbedOptions , values : AnyObject ) {
58+ public static fromTemplate ( template : keyof Templates | MessageEmbedOptions , values : AnyObject ) {
5759 if ( typeof template === 'string' )
5860 if ( templates [ template ] ) template = templates [ template ] ;
5961 else throw new Error ( `Template '${ template } ' not found.` ) ;
You can’t perform that action at this time.
0 commit comments