File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414import technobot .commands .Category ;
1515import technobot .commands .Command ;
1616import technobot .data .GuildData ;
17+ import technobot .util .UtilityMethods ;
1718import technobot .util .embeds .EmbedColor ;
1819import technobot .util .embeds .EmbedUtils ;
1920
@@ -55,7 +56,7 @@ public void execute(SlashCommandInteractionEvent event) {
5556
5657 // Check that bot has necessary permissions
5758 Role botRole = event .getGuild ().getBotRole ();
58- if (!botRole .hasPermission (this .permission ) || member .isOwner ()) {
59+ if (!UtilityMethods .hasPermission (botRole , this .permission ) || member .isOwner ()) {
5960 event .getHook ().sendMessageEmbeds (EmbedUtils .createError ("I couldn't ban that user. Please check my permissions and role position." )).queue ();
6061 return ;
6162 }
Original file line number Diff line number Diff line change 99import technobot .TechnoBot ;
1010import technobot .commands .Category ;
1111import technobot .commands .Command ;
12+ import technobot .util .UtilityMethods ;
1213import technobot .util .embeds .EmbedUtils ;
1314
1415import java .util .concurrent .TimeUnit ;
@@ -37,7 +38,7 @@ public void execute(SlashCommandInteractionEvent event) {
3738
3839 // Check that bot has necessary permissions
3940 Role botRole = event .getGuild ().getBotRole ();
40- if (!botRole .hasPermission (this .permission )) {
41+ if (!UtilityMethods .hasPermission (botRole , this .permission )) {
4142 event .getHook ().sendMessageEmbeds (EmbedUtils .createError ("I couldn't delete those messages. Please check my role and channel permissions." )).queue ();
4243 return ;
4344 }
Original file line number Diff line number Diff line change 1212import technobot .TechnoBot ;
1313import technobot .commands .Category ;
1414import technobot .commands .Command ;
15+ import technobot .util .UtilityMethods ;
1516import technobot .util .embeds .EmbedColor ;
1617import technobot .util .embeds .EmbedUtils ;
1718
@@ -52,7 +53,7 @@ public void execute(SlashCommandInteractionEvent event) {
5253
5354 // Check that bot has necessary permissions
5455 Role botRole = event .getGuild ().getBotRole ();
55- if (!botRole .hasPermission (this .permission ) || target .isOwner ()) {
56+ if (!UtilityMethods .hasPermission (botRole , this .permission ) || target .isOwner ()) {
5657 event .getHook ().sendMessageEmbeds (EmbedUtils .createError ("I couldn't kick that user. Please check my permissions and role position." )).queue ();
5758 return ;
5859 }
Original file line number Diff line number Diff line change 1010import technobot .TechnoBot ;
1111import technobot .commands .Category ;
1212import technobot .commands .Command ;
13+ import technobot .util .UtilityMethods ;
1314import technobot .util .embeds .EmbedUtils ;
1415
1516/**
@@ -32,7 +33,7 @@ public LockCommand(TechnoBot bot) {
3233 public void execute (SlashCommandInteractionEvent event ) {
3334 // Check that bot has necessary permissions
3435 Role botRole = event .getGuild ().getBotRole ();
35- if (!botRole .hasPermission (this .permission )) {
36+ if (!UtilityMethods .hasPermission (botRole , this .permission )) {
3637 event .getHook ().sendMessageEmbeds (EmbedUtils .createError ("I couldn't lock that channel. Please check my role and channel permissions." )).queue ();
3738 return ;
3839 }
Original file line number Diff line number Diff line change 99import technobot .TechnoBot ;
1010import technobot .commands .Category ;
1111import technobot .commands .Command ;
12+ import technobot .util .UtilityMethods ;
1213import technobot .util .embeds .EmbedUtils ;
1314
1415/**
@@ -43,7 +44,7 @@ public void execute(SlashCommandInteractionEvent event) {
4344
4445 // Check that bot has necessary permissions
4546 Role botRole = event .getGuild ().getBotRole ();
46- if (!botRole .hasPermission (this .permission )) {
47+ if (!UtilityMethods .hasPermission (botRole , this .permission )) {
4748 event .replyEmbeds (EmbedUtils .createError ("I couldn't change the roles for that user. Please check my permissions and role position." )).queue ();
4849 return ;
4950 }
Original file line number Diff line number Diff line change 1111import technobot .TechnoBot ;
1212import technobot .commands .Category ;
1313import technobot .commands .Command ;
14+ import technobot .util .UtilityMethods ;
1415import technobot .util .embeds .EmbedUtils ;
1516
1617/**
@@ -40,7 +41,7 @@ public void execute(SlashCommandInteractionEvent event) {
4041
4142 // Check that bot has necessary permissions
4243 Role botRole = event .getGuild ().getBotRole ();
43- if (!botRole .hasPermission (this .permission )) {
44+ if (!UtilityMethods .hasPermission (botRole , this .permission )) {
4445 event .getHook ().sendMessageEmbeds (EmbedUtils .createError ("I couldn't change that user's nickname. Please check my permissions and role position." )).queue ();
4546 return ;
4647 }
Original file line number Diff line number Diff line change 1010import technobot .TechnoBot ;
1111import technobot .commands .Category ;
1212import technobot .commands .Command ;
13+ import technobot .util .UtilityMethods ;
1314import technobot .util .embeds .EmbedUtils ;
1415
1516import java .time .Duration ;
@@ -35,7 +36,7 @@ public SlowmodeCommand(TechnoBot bot) {
3536 public void execute (SlashCommandInteractionEvent event ) {
3637 // Check that bot has necessary permissions
3738 Role botRole = event .getGuild ().getBotRole ();
38- if (!botRole .hasPermission (this .permission )) {
39+ if (!UtilityMethods .hasPermission (botRole , this .permission )) {
3940 event .replyEmbeds (EmbedUtils .createError ("I couldn't set slowmode here. Please check my role and channel permissions." )).queue ();
4041 return ;
4142 }
Original file line number Diff line number Diff line change 1010import technobot .commands .Category ;
1111import technobot .commands .Command ;
1212import technobot .data .GuildData ;
13+ import technobot .util .UtilityMethods ;
1314import technobot .util .embeds .EmbedColor ;
1415import technobot .util .embeds .EmbedUtils ;
1516
@@ -35,7 +36,7 @@ public void execute(SlashCommandInteractionEvent event) {
3536
3637 // Check that bot has necessary permissions
3738 Role botRole = event .getGuild ().getBotRole ();
38- if (!botRole .hasPermission (this .permission )) {
39+ if (!UtilityMethods .hasPermission (botRole , this .permission )) {
3940 event .getHook ().sendMessageEmbeds (EmbedUtils .createError ("I couldn't unban that user. Please check my permissions and role position." )).queue ();
4041 return ;
4142 }
Original file line number Diff line number Diff line change 1010import technobot .TechnoBot ;
1111import technobot .commands .Category ;
1212import technobot .commands .Command ;
13+ import technobot .util .UtilityMethods ;
1314import technobot .util .embeds .EmbedUtils ;
1415
1516/**
@@ -32,7 +33,7 @@ public UnlockCommand(TechnoBot bot) {
3233 public void execute (SlashCommandInteractionEvent event ) {
3334 // Check that bot has necessary permissions
3435 Role botRole = event .getGuild ().getBotRole ();
35- if (!botRole .hasPermission (this .permission )) {
36+ if (!UtilityMethods .hasPermission (botRole , this .permission )) {
3637 event .getHook ().sendMessageEmbeds (EmbedUtils .createError ("I couldn't unlock that channel. Please check my role and channel permissions." )).queue ();
3738 return ;
3839 }
Original file line number Diff line number Diff line change 66import technobot .commands .CommandRegistry ;
77import technobot .data .GuildData ;
88
9+ /**
10+ * Listens for guild event
11+ * Only really used for guild command registration at the moment.
12+ *
13+ * @author TechnoVision
14+ */
915public class GuildListener extends ListenerAdapter {
1016
1117 /**
You can’t perform that action at this time.
0 commit comments