44using Discord . Commands ;
55using Volte . Core . Commands . Preconditions ;
66using Volte . Core . Data ;
7+ using Volte . Core . Extensions ;
78using Volte . Helpers ;
89
910namespace Volte . Core . Commands . Modules . Admin {
@@ -16,24 +17,22 @@ public async Task CustomCommandAdd(string name, [Remainder] string response) {
1617 var config = Db . GetConfig ( Context . Guild ) ;
1718 config . CustomCommands . Add ( name , response ) ;
1819 Db . UpdateConfig ( config ) ;
19- await Context . Channel . SendMessageAsync ( string . Empty , false ,
20- CreateEmbed ( Context , string . Empty )
21- . ToEmbedBuilder ( )
22- . AddField ( "Command Name" , name )
23- . AddField ( "Command Response" , response )
24- . Build ( )
25- ) ;
20+ await Context . CreateEmbed ( string . Empty )
21+ . ToEmbedBuilder ( )
22+ . AddField ( "Command Name" , name )
23+ . AddField ( "Command Response" , response )
24+ . SendTo ( Context . Channel ) ;
2625 }
27-
26+
2827 [ Command ( "CustomCommandRem" ) , Alias ( "Ccr" ) ]
2928 [ Summary ( "Remove a custom command from this guild." ) ]
3029 [ Remarks ( "Usage: |prefix|customcommandrem {cmdName}" ) ]
3130 [ RequireGuildAdmin ]
3231 public async Task CustomCommandRem ( string cmdName ) {
3332 var config = Db . GetConfig ( Context . Guild ) ;
34- var embed = CreateEmbed ( Context , string . Empty ) . ToEmbedBuilder ( )
33+ var embed = Context . CreateEmbed ( string . Empty ) . ToEmbedBuilder ( )
3534 . WithAuthor ( Context . User ) ;
36-
35+
3736 if ( config . CustomCommands . Keys . Contains ( cmdName ) ) {
3837 config . CustomCommands . Remove ( cmdName ) ;
3938 Db . UpdateConfig ( config ) ;
@@ -43,7 +42,7 @@ public async Task CustomCommandRem(string cmdName) {
4342 embed . WithDescription ( $ "**{ cmdName } ** is not a command on this server.") ;
4443 }
4544
46- await Context . Channel . SendMessageAsync ( string . Empty , false , embed . Build ( ) ) ;
45+ await embed . SendTo ( Context . Channel ) ;
4746 }
4847
4948 [ Command ( "CustomCommandClear" ) , Alias ( "Ccc" ) ]
@@ -52,9 +51,9 @@ public async Task CustomCommandRem(string cmdName) {
5251 [ RequireGuildAdmin ]
5352 public async Task CustomCommandClear ( ) {
5453 var config = Db . GetConfig ( Context . Guild ) ;
55- await Context . Channel . SendMessageAsync ( string . Empty , false ,
56- CreateEmbed ( Context ,
57- $ "Cleared the custom commands, containing ** { config . CustomCommands . Count } ** words." ) ) ;
54+ await Context
55+ . CreateEmbed ( $ "Cleared the custom commands, containing ** { config . CustomCommands . Count } ** words." )
56+ . SendTo ( Context . Channel ) ;
5857 config . CustomCommands . Clear ( ) ;
5958 Db . UpdateConfig ( config ) ;
6059 }
0 commit comments