File tree Expand file tree Collapse file tree 23 files changed +418
-30
lines changed Expand file tree Collapse file tree 23 files changed +418
-30
lines changed Original file line number Diff line number Diff line change @@ -179,6 +179,10 @@ export const Api = Object.freeze({
179
179
'/image/tools/convert' ,
180
180
IMAGE_TOOLS_CROP :
181
181
'/image/tools/crop' ,
182
+ IMAGE_TOOLS_CROP_CIRCLE :
183
+ '/image/tools/crop/circle' ,
184
+ IMAGE_TOOLS_CROP_TWITTER_HEX :
185
+ '/image/tools/crop/twitter-hex' ,
182
186
IMAGE_TOOLS_GIF_REVERSE :
183
187
'/image/tools/gif/reverse' ,
184
188
IMAGE_TOOLS_GIF_SEE_SAW :
Original file line number Diff line number Diff line change @@ -815,6 +815,14 @@ export async function imageToolsObjectRemove(
815
815
}
816
816
817
817
818
+ export async function imageToolsObjectRemove (
819
+ context : RequestContext ,
820
+ options : RestOptions . ImageObjectRemoveOptions ,
821
+ ) {
822
+ return raw . imageToolsObjectRemove ( context , options ) ;
823
+ }
824
+
825
+
818
826
export async function imageToolsConvert (
819
827
context : RequestContext ,
820
828
options : RestOptions . ImageToolsConvert ,
@@ -831,6 +839,22 @@ export async function imageToolsCrop(
831
839
}
832
840
833
841
842
+ export async function imageToolsCropCircle (
843
+ context : RequestContext ,
844
+ options : RestOptions . ImageToolsCropCircle ,
845
+ ) {
846
+ return raw . imageToolsCropCircle ( context , options ) ;
847
+ }
848
+
849
+
850
+ export async function imageToolsCropTwitterHex (
851
+ context : RequestContext ,
852
+ options : RestOptions . ImageToolsCropTwitterHex ,
853
+ ) {
854
+ return raw . imageToolsCropTwitterHex ( context , options ) ;
855
+ }
856
+
857
+
834
858
export async function imageToolsGifReverse (
835
859
context : RequestContext ,
836
860
options : RestOptions . ImageBaseOptions ,
Original file line number Diff line number Diff line change @@ -1741,6 +1741,44 @@ export async function imageToolsCrop(
1741
1741
}
1742
1742
1743
1743
1744
+ export async function imageToolsCropCircle (
1745
+ context : RequestContext ,
1746
+ options : RestOptions . ImageToolsCropCircle ,
1747
+ ) : Promise < Response > {
1748
+ const query = {
1749
+ background : options . background ,
1750
+ url : options . url ,
1751
+ } ;
1752
+ return request ( context , {
1753
+ dataOnly : false ,
1754
+ query,
1755
+ route : {
1756
+ method : HTTPMethods . POST ,
1757
+ path : Api . IMAGE_TOOLS_CROP_CIRCLE ,
1758
+ } ,
1759
+ } ) ;
1760
+ }
1761
+
1762
+
1763
+ export async function imageToolsCropTwitterHex (
1764
+ context : RequestContext ,
1765
+ options : RestOptions . ImageToolsCropTwitterHex ,
1766
+ ) : Promise < Response > {
1767
+ const query = {
1768
+ background : options . background ,
1769
+ url : options . url ,
1770
+ } ;
1771
+ return request ( context , {
1772
+ dataOnly : false ,
1773
+ query,
1774
+ route : {
1775
+ method : HTTPMethods . POST ,
1776
+ path : Api . IMAGE_TOOLS_CROP_TWITTER_HEX ,
1777
+ } ,
1778
+ } ) ;
1779
+ }
1780
+
1781
+
1744
1782
export async function imageToolsGifReverse (
1745
1783
context : RequestContext ,
1746
1784
options : RestOptions . ImageBaseOptions ,
Original file line number Diff line number Diff line change @@ -272,6 +272,14 @@ export namespace RestOptions {
272
272
size ?: string ,
273
273
}
274
274
275
+ export interface ImageToolsCropCircle extends ImageBaseOptions {
276
+ background ?: boolean ,
277
+ }
278
+
279
+ export interface ImageToolsCropTwitterHex extends ImageBaseOptions {
280
+ background ?: boolean ,
281
+ }
282
+
275
283
export interface ImageToolsGifSpeed extends ImageBaseOptions {
276
284
loop ?: boolean ,
277
285
speed : number ,
@@ -838,6 +846,7 @@ export namespace RestResponsesRaw {
838
846
spoiler : boolean ,
839
847
spoiler_id : null | number ,
840
848
tag : null | string ,
849
+ thumbnail : string ,
841
850
url : string ,
842
851
width : number ,
843
852
}
Original file line number Diff line number Diff line change
1
+ import { Interaction } from 'detritus-client' ;
2
+
3
+ import { Formatter } from '../../../../utils' ;
4
+
5
+ import { BaseInteractionCommandOption } from '../../basecommand' ;
6
+
7
+
8
+ export const COMMAND_NAME = 'b1' ;
9
+
10
+ export class B1Command extends BaseInteractionCommandOption {
11
+ description = 'Cool B1 Emoji' ;
12
+ metadata = {
13
+ id : Formatter . Commands . FunB1 . COMMAND_ID ,
14
+ } ;
15
+ name = COMMAND_NAME ;
16
+
17
+ async run ( context : Interaction . InteractionContext , args : Formatter . Commands . FunB1 . CommandArgs ) {
18
+ return Formatter . Commands . FunB1 . createMessage ( context , args ) ;
19
+ }
20
+ }
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { Permissions } from 'detritus-client/lib/constants';
2
2
3
3
import { BaseSlashCommand } from '../../basecommand' ;
4
4
5
+ import { B1Command } from './b1' ;
5
6
import { BadMemeCommand } from './badmeme' ;
6
7
7
8
@@ -13,6 +14,7 @@ export default class FunGroupCommand extends BaseSlashCommand {
13
14
super ( {
14
15
permissions : [ Permissions . ATTACH_FILES ] ,
15
16
options : [
17
+ new B1Command ( ) ,
16
18
new BadMemeCommand ( ) ,
17
19
] ,
18
20
} ) ;
Original file line number Diff line number Diff line change
1
+ import { Interaction } from 'detritus-client' ;
2
+
3
+ import { Formatter } from '../../../../../utils' ;
4
+
5
+ import { BaseInteractionImageCommandOption } from '../../../basecommand' ;
6
+
7
+
8
+ export const COMMAND_NAME = 'crop-circle' ;
9
+
10
+ export class ImageToolsCropCircleCommand extends BaseInteractionImageCommandOption {
11
+ description = 'Crop out a circle from an Image' ;
12
+ metadata = {
13
+ id : Formatter . Commands . ImageToolsCropCircle . COMMAND_ID ,
14
+ } ;
15
+ name = COMMAND_NAME ;
16
+
17
+ async run ( context : Interaction . InteractionContext , args : Formatter . Commands . ImageToolsCropCircle . CommandArgs ) {
18
+ return Formatter . Commands . ImageToolsCropCircle . createMessage ( context , args ) ;
19
+ }
20
+ }
Original file line number Diff line number Diff line change
1
+ import { Interaction } from 'detritus-client' ;
2
+
3
+ import { Formatter } from '../../../../../utils' ;
4
+
5
+ import { BaseInteractionImageCommandOption } from '../../../basecommand' ;
6
+
7
+
8
+ export const COMMAND_NAME = 'crop-nft' ;
9
+
10
+ export class ImageToolsCropNFTCommand extends BaseInteractionImageCommandOption {
11
+ description = 'Crop out a Twitter NFT Hex from an Image' ;
12
+ metadata = {
13
+ id : Formatter . Commands . ImageToolsCropNFT . COMMAND_ID ,
14
+ } ;
15
+ name = COMMAND_NAME ;
16
+
17
+ constructor ( ) {
18
+ super ( {
19
+ options : [
20
+ {
21
+ name : 'background' ,
22
+ description : 'Include a dark background (default: False)' ,
23
+ type : Boolean ,
24
+ } ,
25
+ ] ,
26
+ } ) ;
27
+ }
28
+
29
+ async run ( context : Interaction . InteractionContext , args : Formatter . Commands . ImageToolsCropNFT . CommandArgs ) {
30
+ return Formatter . Commands . ImageToolsCropNFT . createMessage ( context , args ) ;
31
+ }
32
+ }
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import { BaseInteractionImageCommandOption } from '../../../basecommand';
8
8
export const COMMAND_NAME = 'crop' ;
9
9
10
10
export class ImageToolsCropCommand extends BaseInteractionImageCommandOption {
11
- description = 'Crop an Image' ;
11
+ description = 'Crop an Image automatically ' ;
12
12
metadata = {
13
13
id : Formatter . Commands . ImageToolsCrop . COMMAND_ID ,
14
14
} ;
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ import { BaseInteractionCommandOptionGroup } from '../../../basecommand';
2
2
3
3
import { ImageToolsConvertCommand } from './convert' ;
4
4
import { ImageToolsCropCommand } from './crop' ;
5
+ import { ImageToolsCropCircleCommand } from './crop-circle' ;
6
+ import { ImageToolsCropNFTCommand } from './crop-nft' ;
5
7
import { ImageJPEGCommand } from './jpeg' ;
6
8
import { ImageToolsResizeCommand } from './resize' ;
7
9
import { ImageSharpenCommand } from './sharpen' ;
@@ -16,6 +18,8 @@ export class ImageToolsGroupCommand extends BaseInteractionCommandOptionGroup {
16
18
options : [
17
19
new ImageToolsConvertCommand ( ) ,
18
20
new ImageToolsCropCommand ( ) ,
21
+ new ImageToolsCropCircleCommand ( ) ,
22
+ new ImageToolsCropNFTCommand ( ) ,
19
23
new ImageJPEGCommand ( ) ,
20
24
new ImageToolsResizeCommand ( ) ,
21
25
new ImageSharpenCommand ( ) ,
You can’t perform that action at this time.
0 commit comments