add scoresaber feed command and websocket impl
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 53s
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 53s
This commit is contained in:
31
src/main/java/cc/fascinated/bat/common/TextChannelUtils.java
Normal file
31
src/main/java/cc/fascinated/bat/common/TextChannelUtils.java
Normal file
@ -0,0 +1,31 @@
|
||||
package cc.fascinated.bat.common;
|
||||
|
||||
import cc.fascinated.bat.service.DiscordService;
|
||||
|
||||
/**
|
||||
* @author Fascinated (fascinated7)
|
||||
*/
|
||||
public class TextChannelUtils {
|
||||
/**
|
||||
* Checks if a channel is valid
|
||||
*
|
||||
* @param id the id of the channel
|
||||
* @return if the channel is valid
|
||||
*/
|
||||
public static boolean isValidChannel(String id) {
|
||||
if (id == null) {
|
||||
return false;
|
||||
}
|
||||
return DiscordService.JDA.getTextChannelById(id) != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the mention of a channel
|
||||
*
|
||||
* @param id the id of the channel
|
||||
* @return the mention of the channel
|
||||
*/
|
||||
public static String getChannelMention(String id) {
|
||||
return "<#" + id + ">";
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user