Migrate clear slashcommand

This commit is contained in:
SebClem 2022-05-15 18:39:46 +02:00
parent 9517a0a318
commit 872dde7695
Signed by: sebclem
GPG Key ID: 5A4308F6A359EA50
83 changed files with 21823 additions and 23135 deletions

View File

@ -1,6 +1,7 @@
<p align="center"><img alt="discord" src="https://claptrapbot.com/favicon.png" width="150"/></p>
# ClaptrapBot: A multifunctional Discord Bot !
[![GitHub Release][releases-shield]][releases]
![Project Stage][project-stage-shield]
[![License][license-shield]](LICENSE.md)
@ -9,16 +10,20 @@
![Project Maintenance][maintenance-shield]
[![Buy me a coffee][buymeacoffee-shield]][buymeacoffee]
## About
ClaptrapBot is a Discord bot. (No way! :open_mouth:)
### Features:
- :notes: Music bot with a cool web control interface !
- :bar_chart: Rank and Stats ! (Text and voice)
- :heart_eyes: NSFW Commands ! (With a daily surprise :kissing_heart:)
- :hammer_and_pick: Moderation commands !
You can add the bot to your server from the home page: https://claptrapbot.com/
## Authors & contributors
The original development is by [SebClem][Sebclem].
@ -55,19 +60,28 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
[license-shield]: https://img.shields.io/github/license/Sebclem/ClaptrapBot.svg
[build-badge]: https://img.shields.io/github/workflow/status/Sebclem/ClaptrapBot/Build
[maintenance-shield]: https://img.shields.io/maintenance/yes/2020.svg
[project-stage-shield]: https://img.shields.io/badge/project%20stage-Beta-red.svg
[buymeacoffee-shield]: https://www.buymeacoffee.com/assets/img/guidelines/download-assets-sm-2.svg
[buymeacoffee]: https://www.buymeacoffee.com/seb6596
[issue]: https://github.com/hassio-addons/addon-log-viewer/issues
[releases-shield]: https://img.shields.io/github/release/Sebclem/ClaptrapBot.svg?include_prereleases
[releases]: https://github.com/Sebclem/ClaptrapBot/releases
[Sebclem]: https://github.com/Sebclem
[alex]: https://github.com/Alexandre064
[Aeka]: https://twitter.com/Le_aeka
[contributors]: https://github.com/Sebclem/ClaptrapBot/graphs/contributors

View File

@ -33,8 +33,6 @@ dependencies {
implementation 'org.codehaus.groovy:groovy-all:3.0.8'
implementation 'com.sedmelluq:lavaplayer:1.3.77'
implementation 'net.dv8tion:JDA:4.4.0_350'
implementation group: 'org.json', name: 'json', version: '20210307'

View File

@ -1,16 +1,17 @@
package net.Broken;
import net.Broken.Commands.Move;
import net.Broken.DB.Entity.GuildPreferenceEntity;
import net.Broken.DB.Entity.UserEntity;
import net.Broken.DB.Repository.GuildPreferenceRepository;
import net.Broken.DB.Repository.UserRepository;
import net.Broken.Tools.*;
import net.Broken.Tools.Command.CommandParser;
import net.Broken.Tools.AutoVoiceChannel;
import net.Broken.Tools.EmbedMessageUtils;
import net.Broken.Tools.UserManager.Stats.UserStatsUtils;
import net.Broken.audio.AudioM;
import net.dv8tion.jda.api.EmbedBuilder;
import net.dv8tion.jda.api.entities.*;
import net.dv8tion.jda.api.MessageBuilder;
import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.entities.Message;
import net.dv8tion.jda.api.entities.Role;
import net.dv8tion.jda.api.entities.TextChannel;
import net.dv8tion.jda.api.events.ReadyEvent;
import net.dv8tion.jda.api.events.guild.GuildJoinEvent;
import net.dv8tion.jda.api.events.guild.member.GuildMemberJoinEvent;
@ -20,16 +21,13 @@ import net.dv8tion.jda.api.events.guild.voice.GuildVoiceLeaveEvent;
import net.dv8tion.jda.api.events.guild.voice.GuildVoiceMoveEvent;
import net.dv8tion.jda.api.events.interaction.SlashCommandEvent;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import net.dv8tion.jda.api.exceptions.InsufficientPermissionException;
import net.dv8tion.jda.api.hooks.ListenerAdapter;
import net.dv8tion.jda.api.managers.GuildManager;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jetbrains.annotations.NotNull;
import org.springframework.context.ApplicationContext;
import java.awt.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@ -38,84 +36,59 @@ import java.util.List;
* Bot Listener
*/
public class BotListener extends ListenerAdapter {
private AntiSpam antispam = new AntiSpam();
private Moderateur modo = new Moderateur();
private final GuildPreferenceRepository guildPreferenceRepository;
private GuildPreferenceRepository guildPreferenceRepository;
private UserRepository userRepository;
private Logger logger = LogManager.getLogger();
private final Logger logger = LogManager.getLogger();
public BotListener() {
ApplicationContext context = SpringContext.getAppContext();
guildPreferenceRepository = (GuildPreferenceRepository) context.getBean("guildPreferenceRepository");
userRepository = (UserRepository) context.getBean("userRepository");
}
@Override
public void onReady(ReadyEvent event) {
logger.info("Connection succees");
logger.info("Connection success");
}
@Override
public void onGuildMemberJoin(GuildMemberJoinEvent event) {
GuildPreferenceEntity guildPref = getPreference(event.getGuild());
if (guildPref.isDefaultRole()) {
logger.info(event.getUser().getName() + "join the guild, move it!");
List<Role> roles = new ArrayList<>();
roles.add(event.getGuild().getRoleById(guildPref.getDefaultRoleId()));
new Move().exc(event.getMember(), roles, false, event.getGuild(), event.getGuild().getManager());
logger.info("[" + event.getGuild().getName() + "] : " + event.getUser().getName() + " join the guild, adding default role !");
Role default_role = event.getGuild().getRoleById(guildPref.getDefaultRoleId());
if (default_role != null) {
event.getGuild().addRoleToMember(event.getMember(), default_role).queue();
} else {
logger.fatal("[" + event.getGuild().getName() + "] : Default role is null !");
}
}
if (guildPref.isWelcome()) {
TextChannel chanel = event.getGuild().getTextChannelById(guildPref.getWelcomeChanelID());
if (chanel != null) {
String message = guildPref.getWelcomeMessage();
message = message.replaceAll("@name", event.getMember().getAsMention());
String message = guildPref.getWelcomeMessage().replaceAll("@name", event.getMember().getAsMention());
logger.debug(message);
chanel.sendMessage(message).complete();
chanel.sendMessage(message).queue();
}else {
logger.fatal("[" + event.getGuild().getName() + "] : Welcome chanel is null !");
}
MainBot.roleFlag = false;
}
}
@Override
public void onGuildMemberRoleRemove(GuildMemberRoleRemoveEvent event) {
GuildPreferenceEntity guildPref = getPreference(event.getGuild());
if (guildPref.isDefaultRole()) {
if (!MainBot.roleFlag) {
if (event.getMember().getRoles().size() == 0) {
logger.info(event.getUser().getName() + "have no roles, move it!");
List<Role> roles = new ArrayList<>();
roles.add(event.getGuild().getRoleById(guildPref.getDefaultRoleId()));
new Move().exc(event.getMember(), roles, false, event.getGuild(), event.getGuild().getManager());
MainBot.roleFlag = false;
logger.info("[" + event.getGuild().getName() + "] : " + event.getUser().getName() + " have no roles, reset to default !");
Role default_role = event.getGuild().getRoleById(guildPref.getDefaultRoleId());
if (default_role == null) {
logger.fatal("[" + event.getGuild().getName() + "] : Default role is null !");
return;
}
} else {
logger.debug("ignore it");
MainBot.roleFlag = false;
event.getGuild().addRoleToMember(event.getMember(), default_role).queue();
}
}
@ -163,59 +136,9 @@ public class BotListener extends ListenerAdapter {
@Override
public void onMessageReceived(MessageReceivedEvent event) {
if (!event.getAuthor().isBot()) {
UserStatsUtils.getINSTANCE().addMessageCount(event.getMember());
}
try {
if (event.getMessage().getContentRaw().startsWith("//") && !event.getMessage().getAuthor().getId().equals(event.getJDA().getSelfUser().getId())) {
//On a detecter que c'etait une commande
//System.out.println(event.getMessage().getContent());
List<UserEntity> users = userRepository.findByJdaId(event.getAuthor().getId());
UserEntity user = users.size() == 0 ? null : users.get(0);
MainBot.handleCommand(new CommandParser().parse(event.getMessage().getContentRaw(), event), user);
} else if (!event.getMessage().getAuthor().getId().equals(event.getJDA().getSelfUser().getId())) {
if (!event.isFromType(ChannelType.PRIVATE)) {
Guild serveur = event.getGuild();
GuildPreferenceEntity guildPref = getPreference(serveur);
if (!guildPref.isAntiSpam())
return;
try {
GuildManager guildManager = serveur.getManager();
Member user = event.getMember();
// appel de la methode d'analyse de message de "Moderateur"
if (event.getMessage().getContentRaw().length() > 0) {
if (modo.analyse(user, serveur, guildManager, event) == 1) {
antispam.extermine(user, serveur, guildManager, true, event);
}
} else if (event.getMessage().getContentRaw().length() == 0)
logger.error("Image detected, ignoring it.");
} catch (InsufficientPermissionException e) {
logger.warn("Insufficient permission for guild " + e.getGuild(MainBot.jda).getName() + " Missing " + e.getPermission() + " permission.");
}
}
}
} catch (Exception e) {
logger.catching(e);
if (event.isFromType(ChannelType.PRIVATE))
PrivateMessage.send(event.getAuthor(), EmbedMessageUtils.getInternalError(), logger);
else
event.getTextChannel().sendMessage(EmbedMessageUtils.getInternalError()).queue();
}
}
@Override
@ -237,14 +160,15 @@ public class BotListener extends ListenerAdapter {
.setDescription("Allow me to introduce myself -- I am a CL4P-TP the discord bot, but my friends call me Claptrap ! Or they would, if any of them were real...\n" +
"\nYou can access to my web UI with: " + MainBot.url)
.setImage("https://i.imgur.com/Anf1Srg.gif");
Message message = new MessageBuilder().setEmbeds(EmbedMessageUtils.buildStandar(eb)).build();
TextChannel defaultChan = event.getGuild().getDefaultChannel();
if (defaultChan != null && defaultChan.canTalk())
defaultChan.sendMessage(EmbedMessageUtils.buildStandar(eb)).queue();
else {
if (defaultChan != null && defaultChan.canTalk()) {
defaultChan.sendMessage(message).queue();
} else {
for (TextChannel chan : event.getGuild().getTextChannels()) {
if (chan.canTalk()) {
chan.sendMessage(EmbedMessageUtils.buildStandar(eb)).queue();
chan.sendMessage(message).queue();
}
}
}
@ -254,9 +178,9 @@ public class BotListener extends ListenerAdapter {
List<GuildPreferenceEntity> guildPrefList = guildPreferenceRepository.findByGuildId(guild.getId());
GuildPreferenceEntity guildPref;
if (guildPrefList.isEmpty()) {
logger.info("Generate default pref");
logger.info("[" + guild.getName() + "] : Generate default pref");
guildPref = GuildPreferenceEntity.getDefault(guild);
guildPreferenceRepository.save(guildPref);
guildPref = guildPreferenceRepository.save(guildPref);
} else
guildPref = guildPrefList.get(0);
return guildPref;

View File

@ -1,71 +0,0 @@
package net.Broken.Commands;
import net.Broken.Commande;
import net.dv8tion.jda.api.entities.ChannelType;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
/**
* Command that return a random picture of cat.
*/
public class Cat implements Commande {
@Override
public void action(String[] args, MessageReceivedEvent event) {
if (!event.isFromType(ChannelType.PRIVATE)) {
try {
URL urlC = new URL("http://aws.random.cat/meow");
URLConnection yc = urlC.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(
yc.getInputStream(), "UTF-8"));
String inputLine;
StringBuilder a = new StringBuilder();
while ((inputLine = in.readLine()) != null)
a.append(inputLine);
in.close();
JSONObject json = new JSONObject(a.toString());
event.getTextChannel().sendMessage(json.getString("file")).queue();
} catch (IOException e) {
e.printStackTrace();
}
} else
event.getPrivateChannel().sendMessage("\n:warning: **__This command cannot be used there !__** :warning:").queue();
}
@Override
public boolean isPrivateUsable() {
return false;
}
@Override
public boolean isAdminCmd() {
return false;
}
/**
* Determines if the command is usable only by bot level admin user
*
* @return boolean
*/
@Override
public boolean isBotAdminCmd() {
return false;
}
@Override
public boolean isNSFW() {
return false;
}
}

View File

@ -1,94 +0,0 @@
package net.Broken.Commands;
import groovy.lang.Binding;
import groovy.lang.GroovyShell;
import net.Broken.Commande;
import net.Broken.DB.Repository.UserRepository;
import net.Broken.SpringContext;
import net.dv8tion.jda.api.EmbedBuilder;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.context.ApplicationContext;
import java.awt.*;
public class Code implements Commande {
private UserRepository userRepository;
private Logger logger = LogManager.getLogger();
public Code() {
ApplicationContext context = SpringContext.getAppContext();
userRepository = (UserRepository) context.getBean("userRepository");
}
@Override
public void action(String[] args, MessageReceivedEvent event) {
StringBuilder stringBuilder = new StringBuilder();
for (String arg : args) {
stringBuilder.append(arg);
stringBuilder.append(" ");
}
Binding binding = new Binding();
binding.setVariable("event", event);
GroovyShell shell = new GroovyShell(binding);
EmbedBuilder builder;
try {
Object value = shell.evaluate(stringBuilder.toString());
StringBuilder stringResult = new StringBuilder();
if (value.getClass().isArray()) {
Object[] array = (Object[]) value;
for (Object obj : array) {
if (stringResult.length() < 1800) {
stringResult.append(obj.toString()).append("\n\n");
} else {
stringResult.append("\n...");
break;
}
}
} else {
stringResult.append(value.toString());
}
builder = new EmbedBuilder().setColor(Color.orange).setTitle(":hammer_pick: Compilation Successful :hammer_pick:").setDescription("```java\n" + stringResult.toString() + "```");
} catch (Exception ex) {
builder = new EmbedBuilder().setColor(Color.red).setTitle(":x: Compilation Failed :x:").setDescription("```java\n" + ex.toString() + "```");
}
event.getChannel().sendMessage(builder.build()).queue();
}
@Override
public boolean isPrivateUsable() {
return true;
}
@Override
public boolean isAdminCmd() {
return true;
}
/**
* Determines if the command is usable only by bot level admin user
*
* @return boolean
*/
@Override
public boolean isBotAdminCmd() {
return true;
}
@Override
public boolean isNSFW() {
return false;
}
}

View File

@ -35,8 +35,6 @@ public class Flush implements Commande {
} else {
event.getTextChannel().sendMessage(EmbedMessageUtils.getFlushError("You are not a supreme being, you cannot do that !")).queue();
}
}
}

View File

@ -1,184 +0,0 @@
package net.Broken.Commands;
import net.Broken.Commande;
import net.Broken.MainBot;
import net.Broken.Tools.EmbedMessageUtils;
import net.Broken.Tools.MessageTimeOut;
import net.Broken.Tools.PrivateMessage;
import net.Broken.Tools.TableRenderer;
import net.dv8tion.jda.api.EmbedBuilder;
import net.dv8tion.jda.api.Permission;
import net.dv8tion.jda.api.entities.ChannelType;
import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.entities.Message;
import net.dv8tion.jda.api.entities.MessageEmbed;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.awt.*;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* Help Command.
*/
public class Help implements Commande {
Logger logger = LogManager.getLogger();
private int cellLenght = 25;
@Override
public void action(String[] args, MessageReceivedEvent event) {
if (args.length >= 1) {
String argsString = args[0];
//System.out.println(argsString);
if (MainBot.commandes.containsKey(argsString)) {
Commande cmdObj = MainBot.commandes.get(argsString);
if (!cmdObj.isAdminCmd() || isAdmin(event)) {
logger.debug("Help for " + argsString + " by " + event.getAuthor().getName());
MessageEmbed messageEmbed;
try {
messageEmbed = EmbedMessageUtils.getHelp(argsString);
} catch (FileNotFoundException e) {
try {
messageEmbed = EmbedMessageUtils.getHelp("Default");
} catch (FileNotFoundException e1) {
messageEmbed = EmbedMessageUtils.getInternalError();
logger.catching(e1);
}
}
if (!event.isFromType(ChannelType.PRIVATE)) {
event.getTextChannel().sendMessage(messageEmbed).queue();
} else {
PrivateMessage.send(event.getAuthor(), messageEmbed, logger);
}
} else {
logger.info("Help wanted for admin command, Denied!");
if (!event.isFromType(ChannelType.PRIVATE)) {
Message rest = event.getTextChannel().sendMessage(EmbedMessageUtils.getUnautorized()).complete();
List<Message> messages = new ArrayList<Message>() {{
add(rest);
add(event.getMessage());
}};
new MessageTimeOut(messages, MainBot.messageTimeOut).start();
} else {
PrivateMessage.send(event.getAuthor(), EmbedMessageUtils.getUnautorized(), logger);
}
}
} else {
if (!event.isFromType(ChannelType.PRIVATE)) {
Message rest = event.getTextChannel().sendMessage(EmbedMessageUtils.getUnknowCommand()).complete();
List<Message> messages = new ArrayList<Message>() {{
add(rest);
add(event.getMessage());
}};
new MessageTimeOut(messages, MainBot.messageTimeOut).start();
} else {
PrivateMessage.send(event.getAuthor(), EmbedMessageUtils.getUnknowCommand(), logger);
}
logger.debug("Unknown command!");
}
} else {
TableRenderer table = new TableRenderer();
table.setHeader("Command", "PU");
TableRenderer nsfwTable = new TableRenderer();
nsfwTable.setHeader("NSFW Only\u00A0", "PU");
List<String> noPu = new ArrayList<>();
for (Map.Entry<String, Commande> e : MainBot.commandes.entrySet()) {
if (!e.getValue().isAdminCmd() || isAdmin(event)) {
if (e.getValue().isPrivateUsable())
table.addRow(e.getKey(), "XX");
else if (e.getValue().isNSFW())
nsfwTable.addRow(e.getKey(), "");
else
noPu.add(e.getKey());
}
}
for (String key : noPu)
table.addRow(key, "");
String txt = table.build();
txt += "\n\n";
txt += nsfwTable.build();
if (!event.isFromType(ChannelType.PRIVATE)) {
Message rest = event.getTextChannel().sendMessage(new EmbedBuilder().setTitle("Commands sent by private message").setColor(Color.green).build()).complete();
new MessageTimeOut(MainBot.messageTimeOut, rest, event.getMessage()).start();
}
String role;
if (isAdmin(event))
role = "Admin";
else
role = "No Admin";
try {
PrivateMessage.send(event.getAuthor(), EmbedMessageUtils.getHelpList(role, txt), logger);
} catch (FileNotFoundException e) {
logger.catching(e);
PrivateMessage.send(event.getAuthor(), EmbedMessageUtils.getInternalError(), logger);
}
}
}
@Override
public boolean isPrivateUsable() {
return true;
}
@Override
public boolean isAdminCmd() {
return false;
}
/**
* Determines if the command is usable only by bot level admin user
*
* @return boolean
*/
@Override
public boolean isBotAdminCmd() {
return false;
}
@Override
public boolean isNSFW() {
return false;
}
public boolean isAdmin(MessageReceivedEvent event) {
if (event.isFromType(ChannelType.PRIVATE)) {
List<Guild> guilds = event.getAuthor().getMutualGuilds();
for (Guild iterator : guilds) {
if (iterator.getMember(event.getAuthor()).hasPermission(Permission.ADMINISTRATOR)) {
return true;
}
}
} else
return event.getMember().hasPermission(Permission.ADMINISTRATOR);
return false;
}
}

View File

@ -1,18 +1,17 @@
package net.Broken.Commands;
import net.Broken.Commande;
import net.Broken.Tools.PrivateMessage;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import org.apache.logging.log4j.LogManager;
public class Invite implements Commande {
@Override
public void action(String[] args, MessageReceivedEvent event) {
if (event.getChannelType().isGuild()) {
event.getTextChannel().sendMessage("You can invite me whit this link:\nhttps://discordapp.com/oauth2/authorize?client_id=" + event.getJDA().getSelfUser().getId() + "&scope=bot&permissions=8").complete();
} else {
PrivateMessage.send(event.getAuthor(), "You can invite me whit this link:\nhttps://discordapp.com/oauth2/authorize?client_id=" + event.getJDA().getSelfUser().getId() + "&scope=bot&permissions=8", LogManager.getLogger());
}
// if (event.getChannelType().isGuild()) {
// event.getTextChannel().sendMessage("You can invite me whit this link:\nhttps://discordapp.com/oauth2/authorize?client_id=" + event.getJDA().getSelfUser().getId() + "&scope=bot&permissions=8").complete();
// } else {
// PrivateMessage.send(event.getAuthor(), "You can invite me whit this link:\nhttps://discordapp.com/oauth2/authorize?client_id=" + event.getJDA().getSelfUser().getId() + "&scope=bot&permissions=8", LogManager.getLogger());
// }
}
@Override

View File

@ -1,48 +0,0 @@
package net.Broken.Commands;
import net.Broken.Commande;
import net.dv8tion.jda.api.EmbedBuilder;
import net.dv8tion.jda.api.entities.Role;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import java.awt.*;
import java.util.List;
public class ListRoles implements Commande {
@Override
public void action(String[] args, MessageReceivedEvent event) {
List<Role> roles = event.getGuild().getRoles();
EmbedBuilder messageB = new EmbedBuilder();
for (Role role : roles) {
messageB.addField(role.getName(), "```id: " + role.getId() + "```", false);
}
messageB.setColor(Color.green);
event.getTextChannel().sendMessage(messageB.build()).complete();
}
@Override
public boolean isPrivateUsable() {
return false;
}
@Override
public boolean isAdminCmd() {
return true;
}
/**
* Determines if the command is usable only by bot level admin user
*
* @return boolean
*/
@Override
public boolean isBotAdminCmd() {
return false;
}
@Override
public boolean isNSFW() {
return false;
}
}

View File

@ -1,182 +0,0 @@
package net.Broken.Commands;
import net.Broken.Commande;
import net.Broken.MainBot;
import net.Broken.Tools.EmbedMessageUtils;
import net.Broken.Tools.MessageTimeOut;
import net.dv8tion.jda.api.entities.*;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import net.dv8tion.jda.api.exceptions.HierarchyException;
import net.dv8tion.jda.api.managers.GuildManager;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.util.ArrayList;
import java.util.List;
/**
* Move Command
*/
public class Move implements Commande {
public List<Role> saveRoleUser;
public Member user;
public Guild serveur;
public GuildManager serveurManager;
Logger logger = LogManager.getLogger();
private String HELP = "`//move <@user> <@Role>`\n:arrow_right:\t*Move a user to a specified role.*";
/**
* Perform a move (Reset is role and add target(s) role(s)
*
* @param user User to move
* @param cible Complete list of new role
* @param reset
* @param serveur Guild
* @param serveurManager GuildManager
* @return success
*/
public boolean exc(Member user, List<Role> cible, boolean reset, Guild serveur, GuildManager serveurManager) throws HierarchyException {
MainBot.roleFlag = true;
boolean erreur = false;
List<Role> allRoll = serveur.getRoles();
//On recupere les roles de l'utilisateur
List<Role> roleUserList = user.getRoles();
logger.info("Roles of " + user.getEffectiveName() + ":");
//On les save
saveRoleUser = roleUserList;
//Ajout du role cible
//On transforme la le role a ajouter en une liste pour pouvoir l'utiliser dans modifyMemberRoles
//on fait ensuite les modif
serveur.modifyMemberRoles(user, cible).complete();
logger.info("Give " + cible + " role to " + user.getEffectiveName());
this.user = user;
this.serveur = serveur;
this.serveurManager = serveurManager;
return erreur;
}
/**
* Command handler
*
* @param args
* @param event
*/
public void action(String[] args, MessageReceivedEvent event) {
if (!event.isFromType(ChannelType.PRIVATE)) {
if (args.length >= 2) {
serveur = event.getGuild();
List<User> userL = event.getMessage().getMentionedUsers();
List<Role> roleL = event.getMessage().getMentionedRoles();
if (userL.size() < 1 || roleL.size() < 1) {
logger.warn("Wrong mention.");
Message rest = event.getTextChannel().sendMessage(EmbedMessageUtils.getMoveError("Error, please check if the user and/or the role are existing.")).complete();
List<Message> messages = new ArrayList<Message>() {{
add(rest);
add(event.getMessage());
}};
new MessageTimeOut(messages, MainBot.messageTimeOut).start();
} else {
user = serveur.getMember(userL.get(0));
serveur = event.getGuild();
logger.info("Attempting role assignement for " + user.getEffectiveName() + " to " + roleL + " by " + event.getAuthor().getName());
logger.info("Permission granted, role assignement authorized");
logger.debug("User found");
try {
boolean erreur = this.exc(user, roleL, true, serveur, serveur.getManager());
if (erreur) {
Message rest = event.getTextChannel().sendMessage(EmbedMessageUtils.getMoveError("Check the targeted role. ")).complete();
List<Message> messages = new ArrayList<Message>() {{
add(rest);
add(event.getMessage());
}};
new MessageTimeOut(messages, MainBot.messageTimeOut).start();
} else {
StringBuilder roleStr = new StringBuilder("");
boolean first = true;
for (Role role : roleL) {
if (!first) {
roleStr.append(", ");
} else
first = false;
roleStr.append("__");
roleStr.append(role.getName());
roleStr.append("__");
}
Message rest = event.getTextChannel().sendMessage(EmbedMessageUtils.getMoveOk("User " + user.getEffectiveName() + " as been successfully moved to " + roleStr.toString())).complete();
List<Message> messages = new ArrayList<Message>() {{
add(rest);
add(event.getMessage());
}};
new MessageTimeOut(messages, MainBot.messageTimeOut).start();
}
} catch (HierarchyException e) {
Message rest = event.getTextChannel().sendMessage(EmbedMessageUtils.getMoveError("You cannot move " + user.getRoles().get(0).getAsMention())).complete();
List<Message> messages = new ArrayList<Message>() {{
add(rest);
add(event.getMessage());
}};
new MessageTimeOut(messages, MainBot.messageTimeOut).start();
logger.error("Hierarchy error, please move bot's role on top!");
}
}
} else {
logger.warn("Missing argument.");
Message rest = event.getTextChannel().sendMessage(EmbedMessageUtils.getMoveError("Missing argument.")).complete();
List<Message> messages = new ArrayList<Message>() {{
add(rest);
add(event.getMessage());
}};
new MessageTimeOut(messages, MainBot.messageTimeOut).start();
}
} else
event.getPrivateChannel().sendMessage(EmbedMessageUtils.getNoPrivate());
}
@Override
public boolean isPrivateUsable() {
return false;
}
@Override
public boolean isAdminCmd() {
return true;
}
/**
* Determines if the command is usable only by bot level admin user
*
* @return boolean
*/
@Override
public boolean isBotAdminCmd() {
return false;
}
@Override
public boolean isNSFW() {
return false;
}
}

View File

@ -1,57 +0,0 @@
package net.Broken.Commands.Over18;
import net.Broken.Commande;
import net.Broken.Tools.FindContentOnWebPage;
import net.Broken.Tools.Redirection;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.IOException;
/**
* TODO Remove this
*/
public class SM implements Commande {
Logger logger = LogManager.getLogger();
@Override
public void action(String[] args, MessageReceivedEvent event) {
Redirection redirect = new Redirection();
try {
String redirectUrl = redirect.get("https://bonjourfetish.tumblr.com/random");
logger.debug(redirectUrl);
String img = FindContentOnWebPage.doYourJob(redirectUrl, "article-picture center", "img");
event.getTextChannel().sendMessage(img).queue();
} catch (IOException e) {
logger.warn("Redirection fail.");
event.getTextChannel().sendMessage(event.getAuthor().getAsMention() + "\n:warning: **__Redirection fail (5 attempt), Try again__**:warning: ").queue();
}
}
@Override
public boolean isPrivateUsable() {
return false;
}
@Override
public boolean isAdminCmd() {
return false;
}
/**
* Determines if the command is usable only by bot level admin user
*
* @return boolean
*/
@Override
public boolean isBotAdminCmd() {
return false;
}
@Override
public boolean isNSFW() {
return true;
}
}

View File

@ -1,83 +0,0 @@
package net.Broken.Commands.Over18;
import net.Broken.Commande;
import net.Broken.Tools.FindContentOnWebPage;
import net.Broken.Tools.Redirection;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.IOException;
public class Suicide implements Commande {
private Logger logger = LogManager.getLogger();
@Override
public void action(String[] args, MessageReceivedEvent event) {
Redirection redirection = new Redirection();
String base = "http://suicidegirls.tumblr.com";
String redirectUrl = null;
try {
Boolean success = false;
int tryCount = 0;
while (!success && tryCount < 10) {
redirectUrl = redirection.get(base + "/random");
String img;
try {
img = FindContentOnWebPage.doYourJob(redirectUrl, "post photo_nav_caption", "img");
event.getTextChannel().sendMessage(img).queue();
success = true;
} catch (StringIndexOutOfBoundsException | IOException e) {
logger.debug("Photo_nav not found try photoset");
try {
String mid = FindContentOnWebPage.doYourJob(redirectUrl, "html_photoset", "iframe");
img = FindContentOnWebPage.doYourJob(base + mid, "photoset_row", "img");
event.getTextChannel().sendMessage(img).queue();
success = true;
} catch (StringIndexOutOfBoundsException | IOException e1) {
logger.debug("Nothing found, assume it's a comment.");
}
}
tryCount++;
}
} catch (IOException e) {
logger.catching(e);
}
}
@Override
public boolean isPrivateUsable() {
return false;
}
@Override
public boolean isAdminCmd() {
return false;
}
/**
* Determines if the command is usable only by bot level admin user
*
* @return boolean
*/
@Override
public boolean isBotAdminCmd() {
return false;
}
@Override
public boolean isNSFW() {
return true;
}
}

View File

@ -1,54 +0,0 @@
package net.Broken.Commands;
import net.Broken.Commande;
import net.Broken.MainBot;
import net.Broken.Tools.MessageTimeOut;
import net.dv8tion.jda.api.entities.ChannelType;
import net.dv8tion.jda.api.entities.Message;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import org.apache.logging.log4j.LogManager;
/**
* Command that return the Bot's ping
*/
public class Ping implements Commande {
@Override
public void action(String[] args, MessageReceivedEvent event) {
long ping = event.getJDA().getGatewayPing();
// long receivedTime = Timestamp.valueOf(LocalDateTime.ofInstant(event.getMessage().getCreationTime().toInstant(), ZoneId.systemDefault())).getTime();
if (event.isFromType(ChannelType.PRIVATE))
event.getPrivateChannel().sendMessage(":arrow_right: Pong! `" + ping + "ms`").queue();
else {
Message rest = event.getTextChannel().sendMessage(event.getAuthor().getAsMention() + "\n:arrow_right: Pong! `" + ping + "ms`").complete();
new MessageTimeOut(MainBot.messageTimeOut, event.getMessage(), rest).start();
}
LogManager.getLogger().debug("pong");
}
@Override
public boolean isPrivateUsable() {
return true;
}
@Override
public boolean isAdminCmd() {
return false;
}
/**
* Determines if the command is usable only by bot level admin user
*
* @return boolean
*/
@Override
public boolean isBotAdminCmd() {
return false;
}
@Override
public boolean isNSFW() {
return false;
}
}

View File

@ -1,311 +0,0 @@
package net.Broken.Commands;
import net.Broken.Commande;
import net.Broken.MainBot;
import net.Broken.Tools.AntiSpam;
import net.Broken.Tools.EmbedMessageUtils;
import net.Broken.Tools.MessageTimeOut;
import net.Broken.Tools.UserSpamUtils;
import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.entities.Member;
import net.dv8tion.jda.api.entities.Message;
import net.dv8tion.jda.api.entities.User;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import net.dv8tion.jda.api.exceptions.RateLimitedException;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
* Spam admin command
*/
// TODO Rebuild this ...
public class Spam implements Commande {
private Logger logger = LogManager.getLogger();
@Override
public void action(String[] args, MessageReceivedEvent event) {
/****************************
* Verif argument *
****************************/
if (args.length >= 1) {
String commande = args[0];
/****************************
* on traite la commande *
****************************/
switch (commande) {
case "pardon":
this.pardon(event, args);
break;
case "extermine":
try {
this.extermine(event, args);
} catch (RateLimitedException e) {
e.printStackTrace();
}
break;
case "reset":
try {
this.reset(event, args);
} catch (RateLimitedException e) {
e.printStackTrace();
}
break;
}
}
}
@Override
public boolean isPrivateUsable() {
return false;
}
@Override
public boolean isAdminCmd() {
return true;
}
/**
* Determines if the command is usable only by bot level admin user
*
* @return boolean
*/
@Override
public boolean isBotAdminCmd() {
return false;
}
@Override
public boolean isNSFW() {
return false;
}
public void pardon(MessageReceivedEvent event, String[] args) {
Guild serveur = event.getGuild();
/****************************
* verif argument *
****************************/
if (args.length >= 1) {
/****************************
* On recupere l'utilisateur et le role cible
****************************/
List<Member> userL = event.getMessage().getMentionedMembers();
/****************************
* verif utilisteur trouver *
****************************/
if (userL.size() < 1) {
logger.error("User unknown.");
Message rest = event.getTextChannel().sendMessage(EmbedMessageUtils.getSpamError(":arrow_right: User not found. ", "pardon")).complete();
List<Message> messages = new ArrayList<Message>() {{
add(rest);
add(event.getMessage());
}};
new MessageTimeOut(messages, MainBot.messageTimeOut).start();
} else {
Member user = userL.get(0);
logger.info("Attempt to forgive " + user.getEffectiveName() + " by " + event.getMember().getEffectiveName());
/****************************
* virif si en spammer *
****************************/
if (MainBot.spamUtils.containsKey(user)) {
if (MainBot.spamUtils.get(user).isOnSpam()) {
MainBot.spamUtils.get(user).setOnSpam(false);
} else {
logger.warn("User is not in spam.");
Message rest = event.getTextChannel().sendMessage(EmbedMessageUtils.getSpamError(":arrow_right: This user is not in spam.", "pardon")).complete();
List<Message> messages = new ArrayList<Message>() {{
add(rest);
add(event.getMessage());
}};
new MessageTimeOut(messages, MainBot.messageTimeOut).start();
}
} else {
logger.warn("User is not in spam.");
Message rest = event.getTextChannel().sendMessage(EmbedMessageUtils.getSpamError(":arrow_right: This user is not in spam.", "pardon")).complete();
List<Message> messages = new ArrayList<Message>() {{
add(rest);
add(event.getMessage());
}};
new MessageTimeOut(messages, MainBot.messageTimeOut).start();
}
}
} else {
logger.warn("Missing argument.");
Message rest = event.getTextChannel().sendMessage(EmbedMessageUtils.getSpamError("Missing argument!", "pardon")).complete();
List<Message> messages = new ArrayList<Message>() {{
add(rest);
add(event.getMessage());
}};
new MessageTimeOut(messages, MainBot.messageTimeOut).start();
}
}
public void extermine(MessageReceivedEvent event, String[] args) throws RateLimitedException {
/****************************
* verif argument *
****************************/
if (args.length >= 3) {
/****************************
* On recupere l'utilisateur et le role cible
****************************/
List<User> userL = event.getMessage().getMentionedUsers();
/****************************
* verif utilisteur trouver *
****************************/
if (userL.size() < 1) {
logger.warn("Wrong mention (Spam).");
Message rest = event.getTextChannel().sendMessage(EmbedMessageUtils.getSpamError("Wrong mention. ", "extermine")).complete();
} else {
Guild serveur = event.getGuild();
Member user = serveur.getMember(userL.get(0));
logger.info("Starting protocol 66 on " + user.getEffectiveName() + " by the command of " + event.getAuthor().getName());
String multiStr = args[2];
/****************************
* virif pas deja en spammer *
****************************/
if (MainBot.spamUtils.containsKey(user)) {
if (!MainBot.spamUtils.get(user).isOnSpam()) {
this.goSpam(user, multiStr, serveur, event);
} else {
logger.warn("User already in spam.");
Message rest = event.getTextChannel().sendMessage(EmbedMessageUtils.getSpamError("User already in spam.", "extermine")).complete();
List<Message> messages = new ArrayList<Message>() {{
add(rest);
add(event.getMessage());
}};
new MessageTimeOut(messages, MainBot.messageTimeOut).start();
}
} else {
this.goSpam(user, multiStr, serveur, event);
}
}
} else {
logger.warn("Missing argument.");
Message rest = event.getTextChannel().sendMessage(EmbedMessageUtils.getSpamError("Missing argument!", "extermine")).complete();
List<Message> messages = new ArrayList<Message>() {{
add(rest);
add(event.getMessage());
}};
new MessageTimeOut(messages, MainBot.messageTimeOut).start();
}
}
public void reset(MessageReceivedEvent event, String[] args) throws RateLimitedException {
if (event != null) {
if (args.length >= 2) {
Guild serveur = event.getGuild();
/****************************
* On recupere l'utilisateur et le role cible
****************************/
List<Member> userL = event.getMessage().getMentionedMembers();
/****************************
* verif utilisteur trouver *
****************************/
if (userL.size() < 1) {
logger.warn("User not found.");
Message rest = event.getTextChannel().sendMessage(EmbedMessageUtils.getSpamError("User not found.", "reset")).complete();
List<Message> messages = new ArrayList<Message>() {{
add(rest);
add(event.getMessage());
}};
new MessageTimeOut(messages, MainBot.messageTimeOut).start();
} else {
Member user = userL.get(0);
logger.info("Attempt spam reset of " + user.getEffectiveName() + " by " + event.getMember().getEffectiveName());
/****************************
* verif utilisteur trouver *
****************************/
if (MainBot.spamUtils.containsKey(user)) {
logger.info("Multiplictor reset for " + user.getEffectiveName() + " done.");
Message rest = event.getTextChannel().sendMessage(event.getAuthor().getAsMention() + "\n *The spam multiplicator of " + user.getEffectiveName() + " is now down to zero.*").complete();
List<Message> messages = new ArrayList<Message>() {{
add(rest);
add(event.getMessage());
}};
new MessageTimeOut(messages, MainBot.messageTimeOut).start();
MainBot.spamUtils.remove(user);
}
}
} else {
logger.warn("Missing argument.");
Message rest = event.getTextChannel().sendMessage(EmbedMessageUtils.getSpamError("Missing argument!", "reset")).complete();
List<Message> messages = new ArrayList<Message>() {{
add(rest);
add(event.getMessage());
}};
new MessageTimeOut(messages, MainBot.messageTimeOut).start();
}
} else {
if (args[0].equals("all")) {
logger.info("Multiplicator reseted automaticly.");
for (Member unUser : MainBot.spamUtils.keySet()) {
MainBot.message_compteur.remove(unUser); //TODO resolve garbage collector error ????
}
}
}
}
public void goSpam(Member user, String multiStr, Guild serveur, MessageReceivedEvent event) {
if (Objects.equals(multiStr, "/")) {
new AntiSpam().extermine(user, serveur, serveur.getManager(), true, event);
} else {
int multi = Integer.parseInt(multiStr);
if (MainBot.spamUtils.containsKey(user)) {
MainBot.spamUtils.get(user).setMultip(multi);
} else {
MainBot.spamUtils.put(user, new UserSpamUtils(user, new ArrayList<>()));
MainBot.spamUtils.get(user).setMultip(multi);
}
new AntiSpam().extermine(user, serveur, serveur.getManager(), false, event);
}
}
}

View File

@ -1,186 +0,0 @@
package net.Broken.Commands;
import net.Broken.Commande;
import net.Broken.MainBot;
import net.Broken.Tools.EmbedMessageUtils;
import net.Broken.Tools.MessageTimeOut;
import net.Broken.Tools.PrivateMessage;
import net.Broken.Tools.UserSpamUtils;
import net.dv8tion.jda.api.EmbedBuilder;
import net.dv8tion.jda.api.entities.ChannelType;
import net.dv8tion.jda.api.entities.Member;
import net.dv8tion.jda.api.entities.Message;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.awt.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.concurrent.TimeUnit;
/**
* Spam Info Command
*/
public class SpamInfo implements Commande {
Logger logger = LogManager.getLogger();
private HashMap<Member, MessageUpdater> threadHashMap = new HashMap<>();
@Override
public void action(String[] args, MessageReceivedEvent event) {
Member user;
if (event.getMessage().getMentionedUsers().size() == 0) {
user = event.getMember();
} else {
user = event.getMessage().getMentionedMembers().get(0);
}
Message message = null;
if (!MainBot.spamUtils.containsKey(user)) {
if (!event.isFromType(ChannelType.PRIVATE))
message = event.getTextChannel().sendMessage(EmbedMessageUtils.getSpamInfo(user.getEffectiveName() + ":\n\t- Multiplicator: `1`\n\t- In spam: `No`")).complete();
else
PrivateMessage.send(event.getAuthor(), EmbedMessageUtils.getSpamInfo(user.getEffectiveName() + ":\n\t- Multiplicator: `1`\n\t- In spam: `No`"), logger);
} else {
UserSpamUtils util = MainBot.spamUtils.get(user);
if (!util.isOnSpam()) {
if (!event.isFromType(ChannelType.PRIVATE))
message = event.getTextChannel().sendMessage(EmbedMessageUtils.getSpamInfo(user.getEffectiveName() + "\n\t- Multiplicator: `" + util.getMultip() + "`\n\t- In spam: `No`")).complete();
else
PrivateMessage.send(event.getAuthor(), EmbedMessageUtils.getSpamInfo(user.getEffectiveName() + ":\n\t- Multiplicator: `" + util.getMultip() + "`\n\t- In spam: `No`"), logger);
} else {
if (!event.isFromType(ChannelType.PRIVATE))
message = event.getTextChannel().sendMessage(EmbedMessageUtils.getSpamInfo(user.getEffectiveName() + ":\n\t- Multiplicator: `" + util.getMultip() + "`\n\t- In spam: `Yes`\n\t- Time remaining: `" + formatSecond(util.getTimeLeft()) + "`")).complete();
else
message = PrivateMessage.send(event.getAuthor(), EmbedMessageUtils.getSpamInfo(user.getEffectiveName() + "\n\t- Multiplicator: `" + util.getMultip() + "`\n\t- In spam: `Yes`\n\t- Time remaining: `" + formatSecond(util.getTimeLeft()) + "`"), logger);
}
}
if (message != null) {
if (threadHashMap.containsKey(user)) {
MessageUpdater startedThread = threadHashMap.get(user);
if (!message.getChannelType().equals(startedThread.message.getChannelType())) {
MessageUpdater newThread = new MessageUpdater(message, event.getMessage(), MainBot.spamUtils.get(user), user);
threadHashMap.put(user, newThread);
newThread.start();
} else {
threadHashMap.get(user).stop = true;
MessageUpdater newThread = new MessageUpdater(message, event.getMessage(), MainBot.spamUtils.get(user), user);
threadHashMap.replace(user, newThread);
newThread.start();
}
} else {
MessageUpdater newThread = new MessageUpdater(message, event.getMessage(), MainBot.spamUtils.get(user), user);
threadHashMap.put(user, newThread);
newThread.start();
}
}
}
@Override
public boolean isPrivateUsable() {
return true;
}
@Override
public boolean isAdminCmd() {
return false;
}
/**
* Determines if the command is usable only by bot level admin user
*
* @return boolean
*/
@Override
public boolean isBotAdminCmd() {
return false;
}
@Override
public boolean isNSFW() {
return false;
}
public String formatSecond(int second) {
long days = TimeUnit.SECONDS.toDays(second);
second -= TimeUnit.DAYS.toSeconds(days);
long hours = TimeUnit.SECONDS.toHours(second);
second -= TimeUnit.HOURS.toSeconds(hours);
long minutes = TimeUnit.SECONDS.toMinutes(second);
second -= TimeUnit.MINUTES.toSeconds(minutes);
long seconds = TimeUnit.SECONDS.toSeconds(second);
logger.debug("" + days + ":" + hours + ":" + minutes + ":" + seconds);
String finalText = "";
if (days != 0)
finalText += days + " day(s) ";
if (hours != 0)
finalText += hours + "h ";
if (minutes != 0)
finalText += minutes + "min ";
finalText += seconds + "s";
return finalText;
}
private class MessageUpdater extends Thread {
public Message message;
public Message command;
public UserSpamUtils util;
public boolean stop;
private int oldValue;
private Member user;
public MessageUpdater(Message message, Message command, UserSpamUtils util, Member user) {
this.message = message;
this.util = util;
this.user = user;
this.command = command;
}
@Override
public void run() {
logger.debug("Start " + user.getEffectiveName() + " theard!");
if (util != null) {
oldValue = util.getTimeLeft();
while (util.getTimeLeft() != 0 && !stop && util.isOnSpam()) {
try {
Thread.sleep(500);
if (util.getTimeLeft() % 5 == 0 && oldValue - util.getTimeLeft() >= 5) {
message.editMessage(EmbedMessageUtils.getSpamInfo(user.getEffectiveName() + ":\n\t- Multiplicator: `" + util.getMultip() + "`\n\t- In spam: `Yes`\n\t- Time remaining: `" + formatSecond(util.getTimeLeft()) + "`")).complete();
oldValue = util.getTimeLeft();
}
} catch (InterruptedException e) {
e.printStackTrace();
}
}
logger.debug("Kill " + user.getEffectiveName() + " theard!");
if (stop)
message.editMessage(new EmbedBuilder().setColor(Color.RED).setTitle("Aborted").build()).complete();
else
message.editMessage(EmbedMessageUtils.getSpamInfo(user.getEffectiveName() + "\n\t- Multiplicator: `" + util.getMultip() + "`\n\t- In spam: `No`")).complete();
}
logger.debug("Timer for message deletion of " + user.getEffectiveName() + " stated...");
threadHashMap.remove(user);
List<Message> messages = new ArrayList<>();
messages.add(command);
messages.add(message);
new MessageTimeOut(messages, 15).start();
}
}
}

View File

@ -1,74 +0,0 @@
package net.Broken.Commands;
import net.Broken.Commande;
import net.Broken.MainBot;
import net.Broken.Tools.EmbedMessageUtils;
import net.Broken.Tools.MessageTimeOut;
import net.Broken.audio.Youtube.SearchResult;
import net.Broken.audio.Youtube.YoutubeSearchRework;
import net.dv8tion.jda.api.entities.Message;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.IOException;
import java.util.List;
public class YtSearch implements Commande {
private Logger logger = LogManager.getLogger();
@Override
public void action(String[] args, MessageReceivedEvent event) {
YoutubeSearchRework youtubeSearch = YoutubeSearchRework.getInstance();
if (args.length < 1) {
logger.info("YtSearch: Missing args, user: " + event.getAuthor().getName());
Message message = event.getChannel().sendMessage(EmbedMessageUtils.buildStandar(EmbedMessageUtils.getError("Missing search query!"))).complete();
new MessageTimeOut(MainBot.messageTimeOut, message, event.getMessage()).start();
} else {
try {
StringBuilder builder = new StringBuilder();
for (String arg : args) {
builder.append(arg);
}
List<SearchResult> result = youtubeSearch.searchVideo(builder.toString(), 5, false);
for (SearchResult item : result) {
event.getChannel().sendMessage(EmbedMessageUtils.searchResult(item)).queue();
}
} catch (IOException t) {
logger.catching(t);
event.getChannel().sendMessage(EmbedMessageUtils.getInternalError()).queue();
}
}
}
@Override
public boolean isPrivateUsable() {
return false;
}
@Override
public boolean isAdminCmd() {
return false;
}
/**
* Determines if the command is usable only by bot level admin user
*
* @return boolean
*/
@Override
public boolean isBotAdminCmd() {
return false;
}
@Override
public boolean isNSFW() {
return false;
}
}

View File

@ -7,7 +7,6 @@ import net.Broken.Tools.Command.CommandLoader;
import net.Broken.Tools.Command.SlashCommandLoader;
import net.Broken.Tools.DayListener.DayListener;
import net.Broken.Tools.DayListener.Listeners.DailyMadame;
import net.Broken.Tools.DayListener.Listeners.ResetSpam;
import net.Broken.Tools.UserManager.Stats.UserStatsUtils;
import net.dv8tion.jda.api.JDA;
import net.dv8tion.jda.api.JDABuilder;
@ -89,7 +88,6 @@ public class Init {
SlashCommandLoader.registerSlashCommands(jda.updateCommands());
ApiCommandLoader.load();
DayListener dayListener = DayListener.getInstance();
dayListener.addListener(new ResetSpam());
dayListener.addListener(new DailyMadame());
dayListener.start();
jda.addEventListener(new BotListener());

View File

@ -1,13 +1,6 @@
package net.Broken;
import net.Broken.DB.Entity.UserEntity;
import net.Broken.Tools.Command.CommandParser;
import net.Broken.Tools.EmbedMessageUtils;
import net.Broken.Tools.PrivateMessage;
import net.Broken.Tools.UserSpamUtils;
import net.dv8tion.jda.api.JDA;
import net.dv8tion.jda.api.Permission;
import net.dv8tion.jda.api.entities.ChannelType;
import net.dv8tion.jda.api.entities.Member;
import net.dv8tion.jda.api.entities.Message;
import org.apache.logging.log4j.LogManager;
@ -30,11 +23,8 @@ public class MainBot {
public static HashMap<String, Commande> commandes = new HashMap<>();
public static HashMap<String, SlashCommand> slashCommands = new HashMap<>();
public static HashMap<Member, ArrayList<Message>> historique = new HashMap<>();
public static HashMap<Member, Integer> message_compteur = new HashMap<>();
public static HashMap<String, Integer> mutualGuildCount = new HashMap<>();
public static boolean roleFlag = false;
public static HashMap<Member, UserSpamUtils> spamUtils = new HashMap<>();
public static JDA jda;
public static boolean ready = false;
public static boolean dev = false;
@ -79,54 +69,4 @@ public class MainBot {
ready = true;
}
/**
* Perform test (admin, NSFW and private usable or not) and execute command or not
*
* @param cmd Container whit all command info
*/
public static void handleCommand(CommandParser.CommandContainer cmd, UserEntity user) {
if (!ready) {
return;
}
if (commandes.containsKey(cmd.commande)) {
Commande cmdObj = commandes.get(cmd.commande);
boolean isAdmin;
boolean isBotAdmin = user != null && user.isBotAdmin();
if (cmd.event.isFromType(ChannelType.PRIVATE)) {
isAdmin = false;
} else
isAdmin = cmd.event.getMember().hasPermission(Permission.ADMINISTRATOR);
if ((!cmdObj.isAdminCmd() || isAdmin) && (!cmdObj.isBotAdminCmd() || isBotAdmin)) {
if (cmd.event.isFromType(ChannelType.PRIVATE) && commandes.get(cmd.commande).isPrivateUsable()) {
commandes.get(cmd.commande).action(cmd.args, cmd.event);
} else if (!cmd.event.isFromType(ChannelType.PRIVATE)) {
if (!cmdObj.isNSFW() || cmd.event.getTextChannel().isNSFW()) {
commandes.get(cmd.commande).action(cmd.args, cmd.event);
} else {
cmd.event.getMessage().delete().queue();
}
} else
cmd.event.getPrivateChannel().sendMessage(EmbedMessageUtils.getNoPrivate()).queue();
} else {
if (cmd.event.isFromType(ChannelType.PRIVATE)) {
PrivateMessage.send(cmd.event.getAuthor(), EmbedMessageUtils.getUnautorized(), logger);
} else {
cmd.event.getTextChannel().sendMessage(EmbedMessageUtils.getUnautorized()).complete();
}
}
} else {
logger.debug("Unknown command : " + cmd.commande);
}
}
}

View File

@ -1,12 +1,15 @@
package net.Broken.RestApi;
import net.Broken.DB.Entity.PendingUserEntity;
import net.Broken.DB.Entity.UserEntity;
import net.Broken.DB.Repository.PendingUserRepository;
import net.Broken.DB.Repository.UserRepository;
import net.Broken.MainBot;
import net.Broken.RestApi.Data.UserManager.*;
import net.Broken.Tools.UserManager.Exceptions.*;
import net.Broken.RestApi.Data.UserManager.GuildInfo;
import net.Broken.RestApi.Data.UserManager.UserConnectionData;
import net.Broken.RestApi.Data.UserManager.UserInfoData;
import net.Broken.Tools.UserManager.Exceptions.PasswordNotMatchException;
import net.Broken.Tools.UserManager.Exceptions.UnknownTokenException;
import net.Broken.Tools.UserManager.Exceptions.UserNotFoundException;
import net.Broken.Tools.UserManager.Oauth;
import net.Broken.Tools.UserManager.Stats.GuildStatsPack;
import net.Broken.Tools.UserManager.Stats.UserStatsUtils;
@ -48,43 +51,43 @@ public class UserManagerAPIController {
}
@RequestMapping(value = "/preRegister", method = RequestMethod.POST)
public ResponseEntity<CheckResposeData> command(@RequestBody UserInfoData data) {
if (data != null && data.name != null) {
try {
String id = userUtils.sendCheckToken(pendingUserRepository, userRepository, passwordEncoder, data);
return new ResponseEntity<>(new CheckResposeData(true, data.name, "Message sent", id), HttpStatus.OK);
} catch (UserNotFoundException e) {
logger.warn("User \"" + data.name + "\" not found!");
return new ResponseEntity<>(new CheckResposeData(false, data.name, "User not found on server!", ""), HttpStatus.NOT_FOUND);
} catch (PasswordNotMatchException userAlreadyRegistered) {
return new ResponseEntity<>(new CheckResposeData(false, data.name, "User already registered in pending database and password not match!", ""), HttpStatus.NOT_ACCEPTABLE);
// @RequestMapping(value = "/preRegister", method = RequestMethod.POST)
// public ResponseEntity<CheckResposeData> command(@RequestBody UserInfoData data) {
// if (data != null && data.name != null) {
// try {
// String id = userUtils.sendCheckToken(pendingUserRepository, userRepository, passwordEncoder, data);
// return new ResponseEntity<>(new CheckResposeData(true, data.name, "Message sent", id), HttpStatus.OK);
// } catch (UserNotFoundException e) {
// logger.warn("User \"" + data.name + "\" not found!");
// return new ResponseEntity<>(new CheckResposeData(false, data.name, "User not found on server!", ""), HttpStatus.NOT_FOUND);
// } catch (PasswordNotMatchException userAlreadyRegistered) {
// return new ResponseEntity<>(new CheckResposeData(false, data.name, "User already registered in pending database and password not match!", ""), HttpStatus.NOT_ACCEPTABLE);
//
// } catch (UserAlreadyRegistered userAlreadyRegistered) {
// return new ResponseEntity<>(new CheckResposeData(false, data.name, "User already registered in database!", ""), HttpStatus.NOT_ACCEPTABLE);
// }
// } else {
// return new ResponseEntity<>(new CheckResposeData(false, "", "Missing parameter(s)", ""), HttpStatus.BAD_REQUEST);
// }
// }
} catch (UserAlreadyRegistered userAlreadyRegistered) {
return new ResponseEntity<>(new CheckResposeData(false, data.name, "User already registered in database!", ""), HttpStatus.NOT_ACCEPTABLE);
}
} else {
return new ResponseEntity<>(new CheckResposeData(false, "", "Missing parameter(s)", ""), HttpStatus.BAD_REQUEST);
}
}
@RequestMapping(value = "/confirmAccount", method = RequestMethod.POST)
public ResponseEntity<UserConnectionData> confirAccount(@RequestBody ConfirmData data) {
try {
PendingUserEntity pUser = userUtils.confirmCheckToken(pendingUserRepository, Integer.parseInt(data.id), data.checkToken);
UserEntity user = new UserEntity(pUser, userUtils.generateApiToken());
userRepository.save(user);
pendingUserRepository.delete(pUser);
return new ResponseEntity<>(new UserConnectionData(true, user.getName(), user.getApiToken(), ""), HttpStatus.OK);
} catch (TokenNotMatch tokenNotMatch) {
logger.warn("Pre token not match for " + data.id + "!");
return new ResponseEntity<>(new UserConnectionData(false, "Token not match!", "token"), HttpStatus.NOT_ACCEPTABLE);
} catch (UserNotFoundException e) {
logger.warn("Id not found in DB (" + data.id + ")");
return new ResponseEntity<>(new UserConnectionData(false, "User not found on DB!", "user"), HttpStatus.NOT_ACCEPTABLE);
}
}
// @RequestMapping(value = "/confirmAccount", method = RequestMethod.POST)
// public ResponseEntity<UserConnectionData> confirAccount(@RequestBody ConfirmData data) {
// try {
// PendingUserEntity pUser = userUtils.confirmCheckToken(pendingUserRepository, Integer.parseInt(data.id), data.checkToken);
// UserEntity user = new UserEntity(pUser, userUtils.generateApiToken());
// userRepository.save(user);
// pendingUserRepository.delete(pUser);
//
// return new ResponseEntity<>(new UserConnectionData(true, user.getName(), user.getApiToken(), ""), HttpStatus.OK);
// } catch (TokenNotMatch tokenNotMatch) {
// logger.warn("Pre token not match for " + data.id + "!");
// return new ResponseEntity<>(new UserConnectionData(false, "Token not match!", "token"), HttpStatus.NOT_ACCEPTABLE);
// } catch (UserNotFoundException e) {
// logger.warn("Id not found in DB (" + data.id + ")");
// return new ResponseEntity<>(new UserConnectionData(false, "User not found on DB!", "user"), HttpStatus.NOT_ACCEPTABLE);
// }
// }
@RequestMapping(value = "/requestToken", method = RequestMethod.POST)
public ResponseEntity<UserConnectionData> requestToken(@RequestBody UserInfoData data) {

View File

@ -12,6 +12,7 @@ import java.util.List;
public interface SlashCommand {
/**
* Main action of command
*
* @param args Command args.
* @param event Command MessageReceivedEvent
*/
@ -25,12 +26,14 @@ public interface SlashCommand {
/**
* Determines if the command is usable only by bot level admin user
*
* @return boolean
*/
boolean isBotAdminCmd();
/**
* Determines if the command is only usable on NSFW channels
*
* @return boolean
*/
boolean isNSFW();

View File

@ -1,15 +1,10 @@
package net.Broken.SlashCommands;
import net.Broken.Commande;
import net.Broken.SlashCommand;
import net.Broken.Tools.EmbedMessageUtils;
import net.dv8tion.jda.api.EmbedBuilder;
import net.dv8tion.jda.api.MessageBuilder;
import net.dv8tion.jda.api.entities.ChannelType;
import net.dv8tion.jda.api.entities.Message;
import net.dv8tion.jda.api.events.interaction.SlashCommandEvent;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import net.dv8tion.jda.api.interactions.commands.build.OptionData;
import net.dv8tion.jda.api.interactions.commands.build.SubcommandData;
import org.apache.logging.log4j.LogManager;
@ -50,7 +45,7 @@ public class Cat implements SlashCommand {
} catch (IOException e) {
logger.catching(e);
event.reply(new MessageBuilder().setEmbeds(EmbedMessageUtils.getInternalError()).build()).queue();
event.reply(new MessageBuilder().setEmbeds(EmbedMessageUtils.getInternalError()).build()).setEphemeral(true).queue();
}
@ -63,7 +58,7 @@ public class Cat implements SlashCommand {
@Override
public List<OptionData> getOptions() {
return new ArrayList<>();
return null;
}
@Override

View File

@ -0,0 +1,58 @@
package net.Broken.SlashCommands;
import net.Broken.SlashCommand;
import net.Broken.Tools.EmbedMessageUtils;
import net.dv8tion.jda.api.EmbedBuilder;
import net.dv8tion.jda.api.MessageBuilder;
import net.dv8tion.jda.api.Permission;
import net.dv8tion.jda.api.entities.Message;
import net.dv8tion.jda.api.entities.MessageChannel;
import net.dv8tion.jda.api.events.interaction.SlashCommandEvent;
import net.dv8tion.jda.api.interactions.commands.OptionType;
import net.dv8tion.jda.api.interactions.commands.build.OptionData;
import net.dv8tion.jda.api.interactions.commands.build.SubcommandData;
import java.util.ArrayList;
import java.util.List;
public class Clear implements SlashCommand {
@Override
public void action(SlashCommandEvent event) {
if (event.getMember().hasPermission(Permission.MESSAGE_MANAGE)) {
event.reply(":white_check_mark: Done").setEphemeral(true).queue();
long n = event.getOption("n").getAsLong();
MessageChannel chanel = event.getChannel();
chanel.getIterableHistory().takeAsync((int) n).thenAccept(chanel::purgeMessages);
} else {
Message message = new MessageBuilder().setEmbeds(EmbedMessageUtils.getFlushError("You are not a supreme being, you cannot do that !")).build();
event.reply(message).setEphemeral(true).queue();
}
}
@Override
public String getDescription() {
return "Clear the last [n] message(s)";
}
@Override
public List<OptionData> getOptions() {
ArrayList<OptionData> options = new ArrayList<>();
options.add(new OptionData(OptionType.INTEGER, "n", "The number of message(s) to clear", true));
return options;
}
@Override
public List<SubcommandData> getSubcommands() {
return null;
}
@Override
public boolean isBotAdminCmd() {
return false;
}
@Override
public boolean isNSFW() {
return false;
}
}

View File

@ -1,10 +1,8 @@
package net.Broken.SlashCommands;
import net.Broken.MainBot;
import net.Broken.SlashCommand;
import net.Broken.Tools.EmbedMessageUtils;
import net.Broken.Tools.MessageTimeOut;
import net.Broken.audio.AudioM;
import net.dv8tion.jda.api.MessageBuilder;
import net.dv8tion.jda.api.entities.Message;
@ -16,13 +14,7 @@ import net.dv8tion.jda.api.interactions.commands.build.OptionData;
import net.dv8tion.jda.api.interactions.commands.build.SubcommandData;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
import java.util.List;

View File

@ -12,13 +12,12 @@ public class SpringContext implements ApplicationContextAware{
@Autowired
static ApplicationContext context;
public static ApplicationContext getAppContext() {
return context;
}
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
context = applicationContext;
}
public static ApplicationContext getAppContext(){
return context;
}
}

View File

@ -1,158 +0,0 @@
package net.Broken.Tools;
import net.Broken.Commands.Move;
import net.Broken.MainBot;
import net.dv8tion.jda.api.entities.*;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import net.dv8tion.jda.api.exceptions.HierarchyException;
import net.dv8tion.jda.api.managers.GuildManager;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.util.ArrayList;
import java.util.List;
import static java.lang.Thread.sleep;
/**
* AntiSpam punishment system
*/
public class AntiSpam {
public Move move = new Move();
Logger logger = LogManager.getLogger();
public AntiSpam() {
}
/**
* Send user to Spam role
*
* @param user User to punish
* @param guild Guild
* @param guildManager GuildManager
* @param incrMulti True for increment punishment time
* @param event Message Received Event
*/
public void extermine(Member user, Guild guild, GuildManager guildManager, Boolean incrMulti, MessageReceivedEvent event) {
try {
sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
// On créer un nouvelle case dans le tableau des statuts si il n'y est pas
if (!MainBot.spamUtils.containsKey(user)) {
List<Message> messages = new ArrayList<>();
messages.addAll(MainBot.historique.get(user));
MainBot.spamUtils.put(user, new UserSpamUtils(user, messages));
}
// On verrifie que l'uttilisateur n'est pas deja en spam
if (!MainBot.spamUtils.get(user).isOnSpam()) {
//l'utilisateur n'est pas deja en spam
if (MainBot.spamUtils.get(user).getMultip() != 0) {
if (MainBot.spamUtils.get(user).getMultip() < 45 && incrMulti) {
MainBot.spamUtils.get(user).setMultip(MainBot.spamUtils.get(user).getMultip() * 2);
}
} else
MainBot.spamUtils.get(user).setMultip(1);
logger.info("Starting protocol 66 on " + user.getEffectiveName() + " with a multiplicator of " + MainBot.spamUtils.get(user));
if (!MainBot.spamUtils.get(user).isOnSpam()) {
MainBot.spamUtils.get(user).setOnSpam(true);
List<Role> spm = guild.getRolesByName("Spammer", false);
if (spm.size() != 0) {
try {
move.exc(user, spm, true, guild, guildManager);
MainBot.spamUtils.get(user).addMessage(event.getTextChannel().sendMessage(EmbedMessageUtils.getSpamExtermine(user, MainBot.spamUtils.get(user.getUser()).getMultip())).complete());
MainBot.spamUtils.get(user).setMinuteur(new Minuteur(MainBot.spamUtils.get(user).getMultip(), move.user, move.saveRoleUser, move.serveur, move.serveurManager, event));
MainBot.spamUtils.get(user).launchMinuteur();
} catch (HierarchyException e) {
Message rest = event.getTextChannel().sendMessage(EmbedMessageUtils.getMoveError("You cannot move a " + user.getRoles().get(0).getAsMention())).complete();
List<Message> messages = new ArrayList<Message>() {{
add(rest);
add(event.getMessage());
}};
new MessageTimeOut(messages, MainBot.messageTimeOut).start();
MainBot.spamUtils.get(user).setOnSpam(false);
}
} else {
MessageEmbed msg = EmbedMessageUtils.buildStandar(EmbedMessageUtils.getError("\nSpam role not found, you need to create it!"));
event.getTextChannel().sendMessage(msg).complete();
}
}
}
}
/**
* Timer to auto remove user from Spam role
*/
public class Minuteur extends Thread {
public TextChannel chanel;
public List<Role> saveRoleUser;
public Member user;
public Guild serveur;
public GuildManager serveurManager;
public int multip;
public MessageReceivedEvent event;
public int timeLeft;
public Minuteur(int multip, Member user, List<Role> saveRoleUser, Guild serveur, GuildManager serveurManager, MessageReceivedEvent event) {
this.multip = multip;
this.user = user;
this.saveRoleUser = saveRoleUser;
this.serveur = serveur;
this.serveurManager = serveurManager;
this.event = event;
this.chanel = event.getTextChannel();
this.timeLeft = 60 * multip;
}
@Override
public void run() {
logger.info("[" + user.getEffectiveName() + "] Start for " + multip + "min");
while (MainBot.spamUtils.get(user).isOnSpam()) {
try {
sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
if (timeLeft <= 0) {
MainBot.spamUtils.get(user.getUser()).setOnSpam(false);
}
timeLeft--;
}
logger.info("[" + user.getEffectiveName() + "] End of spam for " + user.getEffectiveName() + " after " + multip + "min.");
try {
move.exc(user, saveRoleUser, true, serveur, serveurManager); //aSaveroleUser=saveRoleUser.get(i)
} catch (HierarchyException e) {
Message rest = event.getTextChannel().sendMessage(EmbedMessageUtils.getMoveError("You cannot move " + user.getRoles().get(0).getAsMention())).complete();
List<Message> messages = new ArrayList<Message>() {{
add(rest);
add(event.getMessage());
}};
new MessageTimeOut(messages, MainBot.messageTimeOut).start();
logger.error("Hierarchy error");
}
logger.info("[" + user.getEffectiveName() + "] End for " + multip + "min");
new MessageTimeOut(new ArrayList<>(MainBot.spamUtils.get(user).getMessages()), 0).start();
MainBot.spamUtils.get(user).clearAndAdd(chanel.sendMessage(EmbedMessageUtils.getSpamPardon(user)).complete());
new MessageTimeOut(MainBot.spamUtils.get(user).getMessages(), 60).start();
// #-----------------------------------------------#
}
}
}

View File

@ -1,22 +0,0 @@
package net.Broken.Tools.DayListener.Listeners;
import net.Broken.Commands.Spam;
import net.Broken.Tools.DayListener.NewDayListener;
import net.dv8tion.jda.api.exceptions.RateLimitedException;
/**
* Daily spam reset
*/
public class ResetSpam implements NewDayListener {
@Override
public void onNewDay() {
Spam spam = new Spam();
String str[] = {"all"};
try {
spam.reset(null, str);
} catch (RateLimitedException e) {
e.printStackTrace();
}
}
}

View File

@ -3,7 +3,6 @@ package net.Broken.Tools;
import net.Broken.MainBot;
import net.Broken.audio.Youtube.SearchResult;
import net.dv8tion.jda.api.EmbedBuilder;
import net.dv8tion.jda.api.entities.Member;
import net.dv8tion.jda.api.entities.MessageEmbed;
import java.awt.*;
@ -16,26 +15,15 @@ import java.util.Map;
* Pre build Message Embed
*/
public class EmbedMessageUtils {
public static MessageEmbed getUnknowCommand() {
return new EmbedBuilder().setTitle(":warning: Unknown command! :warning:").setDescription(":arrow_right: Use `//help` to see the available commands.").setColor(Color.orange).setFooter(MainBot.url, MainBot.jda.getSelfUser().getAvatarUrl()).setTimestamp(Instant.now()).build();
}
public static EmbedBuilder getError(String message) {
EmbedBuilder temp = new EmbedBuilder().setTitle(":warning: Error! :warning:").setColor(Color.red).setDescription(message);
return temp;
}
public static MessageEmbed getNoPrivate() {
EmbedBuilder temp = new EmbedBuilder().setTitle(":warning: Command not available in private :warning:").setDescription(":arrow_right: Use `//help` to see the available commands.").setColor(Color.red);
return buildStandar(temp);
}
public static MessageEmbed getMusicError(String message) {
return new EmbedBuilder().setTitle(":warning: Musique Error :warning:").setDescription(":arrow_right: " + message).setFooter("'//help music' for more info.", MainBot.jda.getSelfUser().getAvatarUrl()).setTimestamp(Instant.now()).setColor(Color.red).setFooter(MainBot.url, MainBot.jda.getSelfUser().getAvatarUrl()).build();
}
public static MessageEmbed getMusicOk(String message) {
@ -43,75 +31,28 @@ public class EmbedMessageUtils {
return buildStandar(temp);
}
public static MessageEmbed getSpamExtermine(Member autor, int multi) {
return new EmbedBuilder().setTitle(":mute: Spam Hunter :mute:").setDescription(autor.getAsMention() + " detected as spam !\n\nSee you in __**" + multi + "**__ minutes!").setImage("https://media.giphy.com/media/WVudyGEaizNeg/giphy.gif").setFooter("Spam info available with '//spaminfo' in private.", MainBot.jda.getSelfUser().getAvatarUrl()).setTimestamp(Instant.now()).setTimestamp(Instant.now()).setColor(Color.orange).setColor(Color.orange).build();
}
public static MessageEmbed getSpamPardon(Member autor) {
return new EmbedBuilder().setTitle(":mute: Spam Hunter :mute:").setDescription(autor.getAsMention() + " is back , watch out!\nI'm watching you!").setImage("https://media.giphy.com/media/3o7TKwBctlv08kY08M/giphy.gif").setFooter("Spam info available with '//spaminfo' in private.", MainBot.jda.getSelfUser().getAvatarUrl()).setTimestamp(Instant.now()).setColor(Color.orange).build();
}
public static MessageEmbed getHelp(String command) throws FileNotFoundException {
String name = command.substring(0, 1).toUpperCase() + command.substring(1).toLowerCase();
String message = new ResourceLoader().getFile("Help/" + name + "/en/main.md");
EmbedBuilder temp = new EmbedBuilder().setTitle(":question: " + command.substring(0, 1).toUpperCase() + command.substring(1).toLowerCase() + " :question: ").setDescription(message).setColor(Color.green);
return buildStandar(temp);
}
public static MessageEmbed getMoveError(String message) {
return new EmbedBuilder().setTitle(":warning: Move Error :warning: ").setDescription(message).setColor(Color.red).setFooter("'//help move' for more info.", MainBot.jda.getSelfUser().getAvatarUrl()).setTimestamp(Instant.now()).build();
}
public static MessageEmbed getMoveOk(String message) {
EmbedBuilder temp = new EmbedBuilder().setTitle(":arrow_left: Move :arrow_right: ").setDescription(message).setColor(Color.green);
return buildStandar(temp);
}
public static MessageEmbed getSpamError(String message) {
return new EmbedBuilder().setTitle(":warning: Spam Error :warning: ").setDescription(message).setColor(Color.red).setFooter("'//help spam' for more info.", MainBot.jda.getSelfUser().getAvatarUrl()).build();
}
public static MessageEmbed getSpamError(String message, String sub) {
return new EmbedBuilder().setTitle(":warning: Spam Error :warning: ").setDescription(message).setColor(Color.red).setFooter("'//help spam " + sub + "' for more info.", MainBot.jda.getSelfUser().getAvatarUrl()).setThumbnail(MainBot.jda.getSelfUser().getAvatarUrl()).setTimestamp(Instant.now()).build();
}
public static MessageEmbed getSpamInfo(String message) {
EmbedBuilder temp = new EmbedBuilder().setTitle(":hourglass: Spam Info :hourglass:").setDescription(message).setColor(Color.green);
return buildStandar(temp);
}
public static MessageEmbed getFlushError(String message) {
return new EmbedBuilder().setTitle(":warning: Flush Error :warning: ").setDescription(message).setColor(Color.red).setFooter("'//help flush' for more info. ", MainBot.jda.getSelfUser().getAvatarUrl()).setTimestamp(Instant.now()).build();
return buildStandar(new EmbedBuilder().setTitle(":warning: Flush Error :warning: ").setDescription(message).setColor(Color.red));
}
public static MessageEmbed getRegister(String message) {
return buildStandar(new EmbedBuilder().setTitle(":pencil: Web Registration :pencil:").setDescription(message).setColor(Color.green));
}
public static MessageEmbed getInternalError() {
return buildStandar(getError("I... I... I don't feel so good ~~mr stark~~... :thermometer_face: \nPlease contact my developer!").setImage("https://i.imgur.com/anKv8U5.gif"));
}
public static MessageEmbed buildStandar(EmbedBuilder embedBuilder) {
return embedBuilder.setFooter(MainBot.url, MainBot.jda.getSelfUser().getAvatarUrl()).setThumbnail(MainBot.jda.getSelfUser().getAvatarUrl()).setTimestamp(Instant.now()).build();
return embedBuilder.setFooter(MainBot.url, MainBot.jda.getSelfUser().getAvatarUrl()).setTimestamp(Instant.now()).build();
}
public static MessageEmbed getUnautorized() {
return buildStandar(getError("You're not powerful enough to do that slave !").setImage("https://i.imgur.com/0OSsdvW.gif"));
}
public static MessageEmbed getHelpList(String role, String list) throws FileNotFoundException {
String message = new ResourceLoader().getFile("Help/main.md");
message = message.replace("@list", list);
return new EmbedBuilder().setTitle("Bot Command (" + role + ")").setDescription(message).setFooter("Use '//help <command>' for more info", MainBot.jda.getSelfUser().getAvatarUrl()).setTimestamp(Instant.now()).setColor(Color.green).setThumbnail(MainBot.jda.getSelfUser().getAvatarUrl()).build();
}
public static MessageEmbed getLastMessageFromTextChannel(HashMap<String, String> message) {
EmbedBuilder temp = new EmbedBuilder().setTitle("Channel uses checker").setDescription("Last message date for channels:").setColor(Color.green);
for (Map.Entry<String, String> entry : message.entrySet()) {
temp.addField(entry.getKey(), entry.getValue(), false);
}
return buildStandar(temp);
}
@ -119,16 +60,5 @@ public class EmbedMessageUtils {
return new EmbedBuilder().setTitle(":warning: Command error :warning: ").setDescription("").setColor(Color.red).setFooter("'//help move' for more info.", MainBot.jda.getSelfUser().getAvatarUrl()).setTimestamp(Instant.now()).build();
}
public static MessageEmbed searchResult(SearchResult result) {
EmbedBuilder builder = new EmbedBuilder()
.setColor(Color.CYAN)
.setTitle(result.title)
.setImage(result.imageUrl)
.addField("Duration: ", result.duration, false)
.addField("URL:", "https://www.youtube.com/watch?v=" + result.id, false)
.addField("Chanel:", result.channelTittle, false);
return buildStandar(builder);
}
}

View File

@ -1,50 +0,0 @@
package net.Broken.Tools;
import net.dv8tion.jda.api.entities.Message;
import net.dv8tion.jda.api.exceptions.ErrorResponseException;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.util.Arrays;
import java.util.List;
/**
* Auto dell message util
*/
public class MessageTimeOut extends Thread {
List<Message> messages;
int second;
Logger logger = LogManager.getLogger();
public MessageTimeOut(List<Message> messages, int second) {
this.messages = messages;
this.second = second;
}
public MessageTimeOut(int second, Message... messages) {
this.messages = Arrays.asList(messages);
this.second = second;
}
@Override
public void run() {
logger.debug("Timer for message deletion stated...");
for (int i = 0; i < second; i++) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
logger.debug("Time out! Deleting message!");
for (Message aMessage : messages) {
try {
aMessage.delete().queue();
} catch (ErrorResponseException e) {
logger.warn("Unknown Message");
}
}
}
}

View File

@ -1,125 +0,0 @@
package net.Broken.Tools;
import net.Broken.MainBot;
import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.entities.Member;
import net.dv8tion.jda.api.entities.Message;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import net.dv8tion.jda.api.managers.GuildManager;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.util.ArrayList;
/**
* Auto spam utils TODO Rebuild all this shit!
*/
public class Moderateur {
Logger logger = LogManager.getLogger();
public Moderateur() {
}
// Cette méthode récupère le dernier message est le rajoute à "historique"
// SI (spam) retourne 1 (si l'user spam)
// SINON retourne 0
/**
* Get last message and add it on history. After analyse for spam detection
*
* @param user User
* @param guild Guild
* @param guildManager Guild manager
* @param event Message received event
* @return 1 if detected as spam, else 0
*/
public int analyse(Member user, Guild guild, GuildManager guildManager, MessageReceivedEvent event) {
ArrayList<Message> thisUserHistory = new ArrayList<>();//Creer tableau pour la copie
int i = 0; // variable de parcours de "historique"
int nbMessage = 3;
int spam = 0;
if (MainBot.spamUtils.containsKey(user) && MainBot.spamUtils.get(user).isOnSpam()) {
MainBot.spamUtils.get(user).addMessage(event.getMessage());
}
/********************************************
* si l'USER a deja envoyé un message *
********************************************/
if (MainBot.historique.containsKey(user))// Si le user a deja posté un message
{
/********************************************
* COPIE des infos d"historique" vers TOI[] *
********************************************/
thisUserHistory = (ArrayList<Message>) MainBot.historique.get(user).clone();
/********************************************
* Ajout dernier message recu + dans histo' *
********************************************/
thisUserHistory.add(0, event.getMessage());
if (thisUserHistory.size() > nbMessage + 1)
thisUserHistory.remove(4);
MainBot.historique.put(user, thisUserHistory);// On ajoute dans l'historique TOI
/*****************************
* ANALYSE des messages *
*****************************/
int equalCont = 0;
String oldMessage = "";
for (Message aMessage : thisUserHistory) {
if (aMessage.getContentRaw().equals(oldMessage))
equalCont++;
oldMessage = aMessage.getContentRaw();
}
if (equalCont >= nbMessage) {
spam = 1;
logger.info("Spam detected for " + user.getEffectiveName() + "with 3 identical messages : ");
for (Message aMessage : thisUserHistory) {
logger.info("\t - " + aMessage.getContentRaw());
}
MainBot.historique.put(user, new ArrayList<Message>());
}
} else {
/********************************************
* SI c'est le 1er message de l'USER *
********************************************/
// si le user n'a pas encore posté de message
// on ajoute le dernier message dans "historique"
thisUserHistory.add(0, event.getMessage());
MainBot.historique.put(user, thisUserHistory);
}
/**********************************
* AFFICHAGE DE HISTORIQUE *
**********************************/
/********************************************
* Comptage du nombre de message *
********************************************/
if (MainBot.message_compteur.containsKey(user))// Si le user a deja posté un message
{
int cpt = MainBot.message_compteur.get(user);
cpt++;
//System.out.println("compteur : "+cpt);
MainBot.message_compteur.put(user, cpt);
if (cpt > 5) {
MainBot.message_compteur.put(user, 0);
spam = 1;
logger.info("Spam detected for " + user.getEffectiveName() + "with 5 messages in 5 secondes: ");
ArrayList<Message> histo = MainBot.historique.get(user);
for (Message aMessage : histo) {
// logger.debug("\t*"+aMessage.getContent());
}
}
} else {
MainBot.message_compteur.put(user, 1);
}
return spam;
}
}

View File

@ -1,38 +0,0 @@
package net.Broken.Tools;
import net.dv8tion.jda.api.entities.Message;
import net.dv8tion.jda.api.entities.MessageEmbed;
import net.dv8tion.jda.api.entities.User;
import org.apache.logging.log4j.Logger;
/**
* Private message utils
*/
public class PrivateMessage {
/**
* Auto open private channel and send message
*
* @param user User to send message
* @param message Message to send
* @param logger Logger
*/
public static void send(User user, String message, Logger logger) {
user.openPrivateChannel().complete().sendMessage(message).queue();
}
/**
* Auto open private channel and send message
*
* @param user User to send message
* @param message Message to send
* @param logger Logger
* @return Sended Message
*/
public static Message send(User user, MessageEmbed message, Logger logger) {
return user.openPrivateChannel().complete().sendMessage(message).complete();
}
}

View File

@ -7,7 +7,6 @@ import net.Broken.DB.Repository.UserRepository;
import net.Broken.MainBot;
import net.Broken.RestApi.Data.UserManager.UserInfoData;
import net.Broken.Tools.EmbedMessageUtils;
import net.Broken.Tools.PrivateMessage;
import net.Broken.Tools.ResourceLoader;
import net.Broken.Tools.UserManager.Exceptions.*;
import net.dv8tion.jda.api.entities.MessageEmbed;
@ -40,108 +39,6 @@ public class UserUtils {
public static UserUtils getInstance() {
return INSTANCE;
}
/**
* Check if user exist on Guild, if exist, generate and send checkTocken, create entry on PendingUser DB
*
* @param pendingUserRepository Pending user DB interface
* @param userRepository User DB interface
* @param passwordEncoder Password encoder
* @param userInfo Received data
* @return PendingUserEntity PK
* @throws UserNotFoundException User not found in guild
* @throws PasswordNotMatchException User already registered in PendingUser DB but password not match
* @throws UserAlreadyRegistered User already registered in User DB
*/
public String sendCheckToken(PendingUserRepository pendingUserRepository, UserRepository userRepository, PasswordEncoder passwordEncoder, UserInfoData userInfo) throws UserNotFoundException, PasswordNotMatchException, UserAlreadyRegistered {
logger.info("New registration for " + userInfo.name);
List<User> users = MainBot.jda.getUsersByName(userInfo.name, true);
if (users.size() < 1)
throw new UserNotFoundException();
User user = users.get(0);
logger.info("User found!");
PendingUserEntity pendingUserEntity = null;
String token = "";
//Preference if exist on register user
if (userRepository.findByJdaId(user.getId()).size() > 0) {
logger.warn("User already registered!");
throw new UserAlreadyRegistered();
}
//Check if exist in pading user Table
List<PendingUserEntity> pendingUsers = pendingUserRepository.findByJdaId(user.getId());
if (pendingUsers.size() != 0) {
PendingUserEntity thisUser = pendingUsers.get(0);
if (passwordEncoder.matches(userInfo.password, thisUser.getPassword())) {
logger.info("Password matches");
pendingUserEntity = thisUser;
token = thisUser.getCheckToken();
} else {
logger.warn("Password don't match!");
throw new PasswordNotMatchException();
}
}
logger.info("Generating check Token...");
if (token.equals("")) {
token = generateCheckToken();
}
logger.info("Token generated: " + token);
if (pendingUserEntity == null) {
pendingUserEntity = new PendingUserEntity(user.getName(), user.getId(), token, passwordEncoder.encode(userInfo.password));
pendingUserEntity = pendingUserRepository.save(pendingUserEntity);
}
String message = null;
try {
message = new ResourceLoader().getFile("MessagesTemplates/RegisterMessage.md");
} catch (FileNotFoundException e) {
e.printStackTrace();
}
message = message.replace("%code", token);
MessageEmbed ebM = EmbedMessageUtils.getRegister(message);
PrivateMessage.send(user, ebM, logger);
return pendingUserEntity.getId().toString();
}
/**
* Confirm user account
*
* @param pendingUserRepository Pending user DB interface
* @param id UserPendingEntity PK to cofirm
* @param checkToken received token
* @return PendingUserEntity
* @throws TokenNotMatch Given token not match
* @throws UserNotFoundException User not found in Pending user DB
*/
public PendingUserEntity confirmCheckToken(PendingUserRepository pendingUserRepository, int id, String checkToken) throws TokenNotMatch, UserNotFoundException {
PendingUserEntity pendingUser = pendingUserRepository.findById(id);
if (pendingUser != null) {
if (pendingUser.getCheckToken().equals(checkToken)) {
logger.info("Check Token match!");
} else {
logger.warn("Check token not match!");
throw new TokenNotMatch();
}
} else {
logger.warn("Id not Found!");
throw new UserNotFoundException();
}
return pendingUser;
}
/**
* Get user Entity
*

View File

@ -1,67 +0,0 @@
package net.Broken.Tools;
import net.dv8tion.jda.api.entities.Member;
import net.dv8tion.jda.api.entities.Message;
import java.util.List;
/**
* Spam info for one user
*/
public class UserSpamUtils {
private AntiSpam.Minuteur minuteur;
private Member user;
private int multip = 0;
private boolean onSpam = false;
private List<Message> messages;
public UserSpamUtils(Member user, List<Message> messages) {
this.user = user;
this.messages = messages;
}
public int getTimeLeft() {
return minuteur.timeLeft;
}
public int getMultip() {
return multip;
}
public void setMultip(int multip) {
this.multip = multip;
}
public void setMinuteur(AntiSpam.Minuteur minuteur) {
this.minuteur = minuteur;
}
public void launchMinuteur() {
minuteur.start();
}
public boolean isOnSpam() {
return onSpam;
}
public void setOnSpam(boolean onSpam) {
this.onSpam = onSpam;
}
public Member getUser() {
return user;
}
public void addMessage(Message message) {
messages.add(message);
}
public List<Message> getMessages() {
return messages;
}
public void clearAndAdd(Message message) {
messages.clear();
messages.add(message);
}
}

View File

@ -1,4 +0,0 @@
Hey look! A cat!
And he's different everytime !
That is so cute! :cat:

View File

@ -1,4 +0,0 @@
Ho! Regarde! Un chat!
Mais il est different à chaque fois en plus!
C'est trop cute! :cat:

View File

@ -1,5 +0,0 @@
This command allow you to see which text channel is used by
returning the date from the last message sent in every text channel.
You can add a date in the format "day.month.year" to return channels
that don't have new message since this date.

View File

@ -1,6 +0,0 @@
Cette commande permet de verifier quels channels textes ne sont
pas utilisés en remontant la date du dernier message envoyé
dans tout les channels.
Vous pouvez ajouter une date au format "jour.mois.année" pour remonter les channels
qui n'ont pas eu de message depuis avant cette date.

View File

@ -1,2 +0,0 @@
This command doesn't have any help at the moment.
To help us improve: https://github.com/BrokenFire/BrokenDiscordBot

View File

@ -1,2 +0,0 @@
L'aide pour cette commande n'est pas encore disponible !
Pour contribué: https://github.com/BrokenFire/BrokenDiscordBot

View File

@ -1,3 +0,0 @@
`//flush <number>`
:arrow_right: *Erase the n last posts (Max = 100)*

View File

@ -1,3 +0,0 @@
`//flush <nbr>`
:arrow_right: *Efface les n derniers messages (Max = 100)*

View File

@ -1,2 +0,0 @@
`//move <@user> <@targeted_role>`
:arrow_right: *Move an user to the targeted role.*

View File

@ -1,2 +0,0 @@
`//move <@utilisateur> <@rôleCible>`
:arrow_right: *Deplacement d'un utilisateur vers un rôle cible, attention à bien faire les mentions.*

View File

@ -1,26 +0,0 @@
`//music play <url>`
:arrow_right: *Let's dance! Sets the vocal chat to use.*
`//music pause`
:arrow_right: *Pause the current track.*
`//music resume`
:arrow_right: *Resume the current track.*
`//music next`
:arrow_right: *Skip the current track.*
`//music stop`
:arrow_right: *Stop the current track and empty the playlist.*
`//music info`
:arrow_right: *Show info of the current track.*
`//music flush`
:arrow_right: *Delete the current playlist.*
`//music list`
:arrow_right: *Show information of the current playlist.*
`//music add(Next) <url>`
:arrow_right: *Add the url to the current playlist.*

View File

@ -1,26 +0,0 @@
`//music play <url>`
:arrow_right: *Let's dance! Definit le chat vocal à utiliser.*
`//music pause`
:arrow_right: *Mise en pause de la piste en cours.*
`//music resume`
:arrow_right: *Reprise de la lecture de la piste en cours.*
`//music next`
:arrow_right: *Change la piste en cours.*
`//music stop`
:arrow_right: *Arrête la piste en cours et supprime la playlist.*
`//music info`
:arrow_right: *Affiche les infos de la piste en cours.*
`//music flush`
:arrow_right: *Supprime la playlist en cours.*
`//music list`
:arrow_right: *Affiche la playlist en cours.*
`//music add(Next) <url>`
:arrow_right: *Ajoute l'url à la playlist en cours.*

View File

@ -1,2 +0,0 @@
`//ping`
:arrow_right: *Send back the bot's ping*

View File

@ -1,2 +0,0 @@
`//ping`
:arrow_right: *Renvoi le ping du bot*

View File

@ -1,8 +0,0 @@
`//spam extermine <@user> <multiplier>`
:arrow_right: *Penalize a spammer.*
`//spam pardon <@user>`
:arrow_right: *Forgive a spammer*
`//spam reset <@user>`
:arrow_right: *Reset the user's multiplier.*

View File

@ -1,8 +0,0 @@
`//spam extermine <@utilisateur> <multiplicateur>`
:arrow_right: *Punir un spammeur.*
`//spam pardon <@utilisateur>`
:arrow_right: *Annuler la punition d'un utilisateur.*
`//spam reset <@utilisateur>`
:arrow_right: *RAZ du multiplicateur d'un utilisateur.*

View File

@ -1,2 +0,0 @@
`//spaminfo <@user> `
:arrow_right: *Show punishment's information against the spam of the mentioned user (the author if there is no mention)*

View File

@ -1,2 +0,0 @@
`//spaminfo <@utilisateur> `
:arrow_right: *Affiche les infos relatives aux punitions contre le spam de l'utilisateur mentionnée (de l'auteur si pas de mention)*

View File

@ -1,7 +0,0 @@
```
@list
```
_PU = Private Usable
**>** __**[Web UI](https://claptrapbot.com )**__ :arrow_right: Music control, Settings, News

View File

@ -1,4 +1,3 @@
An attempt to associate your discord name was requested.
Here is the verification code:

View File

@ -1,16 +1,21 @@
<Configuration status="error" packages="com.coralogix.sdk.appenders">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<!--<PatternLayout pattern="[%d{HH:mm:ss.SSS}][%-5level][%-30.30c{1.}]: %msg%n" />-->
<PatternLayout>
<Pattern>[%d{HH:mm:ss.SSS}]%highlight{[%-5level]}{FATAL=red blink, ERROR=red, WARN=bright yellow , INFO=blue, DEBUG=bright black, TRACE=cyan}[%-30.30c{1.}]: %highlight{%msg%n}{FATAL=red blink, ERROR=red, WARN=bright yellow , INFO=blue, DEBUG=bright black, TRACE=cyan}</Pattern>
<Pattern>[%d{HH:mm:ss.SSS}]%highlight{[%-5level]}{FATAL=red blink, ERROR=red, WARN=bright yellow ,
INFO=blue, DEBUG=bright black, TRACE=cyan}[%-30.30c{1.}]: %highlight{%msg%n}{FATAL=red blink,
ERROR=red, WARN=bright yellow , INFO=blue, DEBUG=bright black, TRACE=cyan}
</Pattern>
</PatternLayout>
</Console>
<RollingFile name="RollingFile" fileName="./logs/current-day.log"
filePattern="./logs/$${date:yyyy-MM}/discordBot-%d{yyyy-MM-dd}-%i.log.gz">
<PatternLayout>
<Pattern>[%d{HH:mm:ss.SSS}]%highlight{[%-5level]}{FATAL=red blink, ERROR=red, WARN=bright yellow , INFO=blue, DEBUG=bright black, TRACE=cyan}[%-30.30c{1.}]: %highlight{%msg%n}{FATAL=red blink, ERROR=red, WARN=bright yellow , INFO=blue, DEBUG=bright black, TRACE=cyan}</Pattern>
<Pattern>[%d{HH:mm:ss.SSS}]%highlight{[%-5level]}{FATAL=red blink, ERROR=red, WARN=bright yellow ,
INFO=blue, DEBUG=bright black, TRACE=cyan}[%-30.30c{1.}]: %highlight{%msg%n}{FATAL=red blink,
ERROR=red, WARN=bright yellow , INFO=blue, DEBUG=bright black, TRACE=cyan}
</Pattern>
</PatternLayout>
<Policies>
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
@ -20,7 +25,10 @@
</RollingFile>
<File name="current" fileName="logs/current.log" append="false">
<PatternLayout>
<Pattern>[%d{HH:mm:ss.SSS}]%highlight{[%-5level]}{FATAL=red blink, ERROR=red, WARN=bright yellow , INFO=blue, DEBUG=bright black, TRACE=cyan}[%-30.30c{1.}]: %highlight{%msg%n}{FATAL=red blink, ERROR=red, WARN=bright yellow , INFO=blue, DEBUG=bright black, TRACE=cyan}</Pattern>
<Pattern>[%d{HH:mm:ss.SSS}]%highlight{[%-5level]}{FATAL=red blink, ERROR=red, WARN=bright yellow ,
INFO=blue, DEBUG=bright black, TRACE=cyan}[%-30.30c{1.}]: %highlight{%msg%n}{FATAL=red blink,
ERROR=red, WARN=bright yellow , INFO=blue, DEBUG=bright black, TRACE=cyan}
</Pattern>
</PatternLayout>
</File>
</Appenders>

View File

@ -45,7 +45,9 @@
font-weight: normal;
}
.gha-feed small a .more-commits { font-size: 11px; }
.gha-feed small a .more-commits {
font-size: 11px;
}
span.gha-time {
color: #bbb;
@ -118,8 +120,13 @@ span.gha-time {
font-weight: bold;
}
.gha-footer a:hover { text-decoration: none; }
.gha-header a:hover { text-decoration: none; }
.gha-footer a:hover {
text-decoration: none;
}
.gha-header a:hover {
text-decoration: none;
}
.gha-github-icon {
display: inline;
@ -203,7 +210,9 @@ span.gha-time {
width: calc(100% - 50px);
}
.gha-message-commits { font-size: 11px; }
.gha-message-commits {
font-size: 11px;
}
.gha-message-merge {
padding: 3px 7px;
@ -230,7 +239,9 @@ span.gha-time {
border-radius: 2px;
}
.gha-gravatar-user { float: left; }
.gha-gravatar-user {
float: left;
}
.gha-user-info {
display: inline-block;
@ -241,8 +252,13 @@ span.gha-time {
font-size: 20px;
}
.gha-user-info a { color: #495961; }
.gha-user-info p a { font-weight: 100; }
.gha-user-info a {
color: #495961;
}
.gha-user-info p a {
font-weight: 100;
}
.gha-without-name {
padding-top: 20px;
@ -266,7 +282,18 @@ span.gha-time {
font-size: 12px;
}
.gha-clear { clear: both; }
.gha-muted { color: #666; }
.gha-push { height: 87px; }
.gha-push-small { height: 26px; }
.gha-clear {
clear: both;
}
.gha-muted {
color: #666;
}
.gha-push {
height: 87px;
}
.gha-push-small {
height: 26px;
}

View File

@ -2768,10 +2768,12 @@ video.responsive-video {
.pagination {
width: 100%;
}
.pagination li.prev,
.pagination li.next {
width: 10%;
}
.pagination li.pages {
width: 80%;
overflow: hidden;
@ -3026,28 +3028,35 @@ td, th {
position: relative;
/* sort out borders */
}
table.responsive-table td:empty:before {
content: '\00a0';
}
table.responsive-table th,
table.responsive-table td {
margin: 0;
vertical-align: top;
}
table.responsive-table th {
text-align: left;
}
table.responsive-table thead {
display: block;
float: left;
}
table.responsive-table thead tr {
display: block;
padding: 0 10px 0 0;
}
table.responsive-table thead tr th::before {
content: "\00a0";
}
table.responsive-table tbody {
display: block;
width: auto;
@ -3055,23 +3064,28 @@ td, th {
overflow-x: auto;
white-space: nowrap;
}
table.responsive-table tbody tr {
display: inline-block;
vertical-align: top;
}
table.responsive-table th {
display: block;
text-align: right;
}
table.responsive-table td {
display: block;
min-height: 1.25em;
text-align: left;
}
table.responsive-table tr {
border-bottom: none;
padding: 0 10px;
}
table.responsive-table thead {
border: 0;
border-right: 1px solid rgba(0, 0, 0, 0.12);
@ -3727,177 +3741,224 @@ table span.badge {
left: auto;
right: auto;
}
.row .col.m2 {
width: 16.6666666667%;
margin-left: auto;
left: auto;
right: auto;
}
.row .col.m3 {
width: 25%;
margin-left: auto;
left: auto;
right: auto;
}
.row .col.m4 {
width: 33.3333333333%;
margin-left: auto;
left: auto;
right: auto;
}
.row .col.m5 {
width: 41.6666666667%;
margin-left: auto;
left: auto;
right: auto;
}
.row .col.m6 {
width: 50%;
margin-left: auto;
left: auto;
right: auto;
}
.row .col.m7 {
width: 58.3333333333%;
margin-left: auto;
left: auto;
right: auto;
}
.row .col.m8 {
width: 66.6666666667%;
margin-left: auto;
left: auto;
right: auto;
}
.row .col.m9 {
width: 75%;
margin-left: auto;
left: auto;
right: auto;
}
.row .col.m10 {
width: 83.3333333333%;
margin-left: auto;
left: auto;
right: auto;
}
.row .col.m11 {
width: 91.6666666667%;
margin-left: auto;
left: auto;
right: auto;
}
.row .col.m12 {
width: 100%;
margin-left: auto;
left: auto;
right: auto;
}
.row .col.offset-m1 {
margin-left: 8.3333333333%;
}
.row .col.pull-m1 {
right: 8.3333333333%;
}
.row .col.push-m1 {
left: 8.3333333333%;
}
.row .col.offset-m2 {
margin-left: 16.6666666667%;
}
.row .col.pull-m2 {
right: 16.6666666667%;
}
.row .col.push-m2 {
left: 16.6666666667%;
}
.row .col.offset-m3 {
margin-left: 25%;
}
.row .col.pull-m3 {
right: 25%;
}
.row .col.push-m3 {
left: 25%;
}
.row .col.offset-m4 {
margin-left: 33.3333333333%;
}
.row .col.pull-m4 {
right: 33.3333333333%;
}
.row .col.push-m4 {
left: 33.3333333333%;
}
.row .col.offset-m5 {
margin-left: 41.6666666667%;
}
.row .col.pull-m5 {
right: 41.6666666667%;
}
.row .col.push-m5 {
left: 41.6666666667%;
}
.row .col.offset-m6 {
margin-left: 50%;
}
.row .col.pull-m6 {
right: 50%;
}
.row .col.push-m6 {
left: 50%;
}
.row .col.offset-m7 {
margin-left: 58.3333333333%;
}
.row .col.pull-m7 {
right: 58.3333333333%;
}
.row .col.push-m7 {
left: 58.3333333333%;
}
.row .col.offset-m8 {
margin-left: 66.6666666667%;
}
.row .col.pull-m8 {
right: 66.6666666667%;
}
.row .col.push-m8 {
left: 66.6666666667%;
}
.row .col.offset-m9 {
margin-left: 75%;
}
.row .col.pull-m9 {
right: 75%;
}
.row .col.push-m9 {
left: 75%;
}
.row .col.offset-m10 {
margin-left: 83.3333333333%;
}
.row .col.pull-m10 {
right: 83.3333333333%;
}
.row .col.push-m10 {
left: 83.3333333333%;
}
.row .col.offset-m11 {
margin-left: 91.6666666667%;
}
.row .col.pull-m11 {
right: 91.6666666667%;
}
.row .col.push-m11 {
left: 91.6666666667%;
}
.row .col.offset-m12 {
margin-left: 100%;
}
.row .col.pull-m12 {
right: 100%;
}
.row .col.push-m12 {
left: 100%;
}
@ -3910,177 +3971,224 @@ table span.badge {
left: auto;
right: auto;
}
.row .col.l2 {
width: 16.6666666667%;
margin-left: auto;
left: auto;
right: auto;
}
.row .col.l3 {
width: 25%;
margin-left: auto;
left: auto;
right: auto;
}
.row .col.l4 {
width: 33.3333333333%;
margin-left: auto;
left: auto;
right: auto;
}
.row .col.l5 {
width: 41.6666666667%;
margin-left: auto;
left: auto;
right: auto;
}
.row .col.l6 {
width: 50%;
margin-left: auto;
left: auto;
right: auto;
}
.row .col.l7 {
width: 58.3333333333%;
margin-left: auto;
left: auto;
right: auto;
}
.row .col.l8 {
width: 66.6666666667%;
margin-left: auto;
left: auto;
right: auto;
}
.row .col.l9 {
width: 75%;
margin-left: auto;
left: auto;
right: auto;
}
.row .col.l10 {
width: 83.3333333333%;
margin-left: auto;
left: auto;
right: auto;
}
.row .col.l11 {
width: 91.6666666667%;
margin-left: auto;
left: auto;
right: auto;
}
.row .col.l12 {
width: 100%;
margin-left: auto;
left: auto;
right: auto;
}
.row .col.offset-l1 {
margin-left: 8.3333333333%;
}
.row .col.pull-l1 {
right: 8.3333333333%;
}
.row .col.push-l1 {
left: 8.3333333333%;
}
.row .col.offset-l2 {
margin-left: 16.6666666667%;
}
.row .col.pull-l2 {
right: 16.6666666667%;
}
.row .col.push-l2 {
left: 16.6666666667%;
}
.row .col.offset-l3 {
margin-left: 25%;
}
.row .col.pull-l3 {
right: 25%;
}
.row .col.push-l3 {
left: 25%;
}
.row .col.offset-l4 {
margin-left: 33.3333333333%;
}
.row .col.pull-l4 {
right: 33.3333333333%;
}
.row .col.push-l4 {
left: 33.3333333333%;
}
.row .col.offset-l5 {
margin-left: 41.6666666667%;
}
.row .col.pull-l5 {
right: 41.6666666667%;
}
.row .col.push-l5 {
left: 41.6666666667%;
}
.row .col.offset-l6 {
margin-left: 50%;
}
.row .col.pull-l6 {
right: 50%;
}
.row .col.push-l6 {
left: 50%;
}
.row .col.offset-l7 {
margin-left: 58.3333333333%;
}
.row .col.pull-l7 {
right: 58.3333333333%;
}
.row .col.push-l7 {
left: 58.3333333333%;
}
.row .col.offset-l8 {
margin-left: 66.6666666667%;
}
.row .col.pull-l8 {
right: 66.6666666667%;
}
.row .col.push-l8 {
left: 66.6666666667%;
}
.row .col.offset-l9 {
margin-left: 75%;
}
.row .col.pull-l9 {
right: 75%;
}
.row .col.push-l9 {
left: 75%;
}
.row .col.offset-l10 {
margin-left: 83.3333333333%;
}
.row .col.pull-l10 {
right: 83.3333333333%;
}
.row .col.push-l10 {
left: 83.3333333333%;
}
.row .col.offset-l11 {
margin-left: 91.6666666667%;
}
.row .col.pull-l11 {
right: 91.6666666667%;
}
.row .col.push-l11 {
left: 91.6666666667%;
}
.row .col.offset-l12 {
margin-left: 100%;
}
.row .col.pull-l12 {
right: 100%;
}
.row .col.push-l12 {
left: 100%;
}
@ -4093,177 +4201,224 @@ table span.badge {
left: auto;
right: auto;
}
.row .col.xl2 {
width: 16.6666666667%;
margin-left: auto;
left: auto;
right: auto;
}
.row .col.xl3 {
width: 25%;
margin-left: auto;
left: auto;
right: auto;
}
.row .col.xl4 {
width: 33.3333333333%;
margin-left: auto;
left: auto;
right: auto;
}
.row .col.xl5 {
width: 41.6666666667%;
margin-left: auto;
left: auto;
right: auto;
}
.row .col.xl6 {
width: 50%;
margin-left: auto;
left: auto;
right: auto;
}
.row .col.xl7 {
width: 58.3333333333%;
margin-left: auto;
left: auto;
right: auto;
}
.row .col.xl8 {
width: 66.6666666667%;
margin-left: auto;
left: auto;
right: auto;
}
.row .col.xl9 {
width: 75%;
margin-left: auto;
left: auto;
right: auto;
}
.row .col.xl10 {
width: 83.3333333333%;
margin-left: auto;
left: auto;
right: auto;
}
.row .col.xl11 {
width: 91.6666666667%;
margin-left: auto;
left: auto;
right: auto;
}
.row .col.xl12 {
width: 100%;
margin-left: auto;
left: auto;
right: auto;
}
.row .col.offset-xl1 {
margin-left: 8.3333333333%;
}
.row .col.pull-xl1 {
right: 8.3333333333%;
}
.row .col.push-xl1 {
left: 8.3333333333%;
}
.row .col.offset-xl2 {
margin-left: 16.6666666667%;
}
.row .col.pull-xl2 {
right: 16.6666666667%;
}
.row .col.push-xl2 {
left: 16.6666666667%;
}
.row .col.offset-xl3 {
margin-left: 25%;
}
.row .col.pull-xl3 {
right: 25%;
}
.row .col.push-xl3 {
left: 25%;
}
.row .col.offset-xl4 {
margin-left: 33.3333333333%;
}
.row .col.pull-xl4 {
right: 33.3333333333%;
}
.row .col.push-xl4 {
left: 33.3333333333%;
}
.row .col.offset-xl5 {
margin-left: 41.6666666667%;
}
.row .col.pull-xl5 {
right: 41.6666666667%;
}
.row .col.push-xl5 {
left: 41.6666666667%;
}
.row .col.offset-xl6 {
margin-left: 50%;
}
.row .col.pull-xl6 {
right: 50%;
}
.row .col.push-xl6 {
left: 50%;
}
.row .col.offset-xl7 {
margin-left: 58.3333333333%;
}
.row .col.pull-xl7 {
right: 58.3333333333%;
}
.row .col.push-xl7 {
left: 58.3333333333%;
}
.row .col.offset-xl8 {
margin-left: 66.6666666667%;
}
.row .col.pull-xl8 {
right: 66.6666666667%;
}
.row .col.push-xl8 {
left: 66.6666666667%;
}
.row .col.offset-xl9 {
margin-left: 75%;
}
.row .col.pull-xl9 {
right: 75%;
}
.row .col.push-xl9 {
left: 75%;
}
.row .col.offset-xl10 {
margin-left: 83.3333333333%;
}
.row .col.pull-xl10 {
right: 83.3333333333%;
}
.row .col.push-xl10 {
left: 83.3333333333%;
}
.row .col.offset-xl11 {
margin-left: 91.6666666667%;
}
.row .col.pull-xl11 {
right: 91.6666666667%;
}
.row .col.push-xl11 {
left: 91.6666666667%;
}
.row .col.offset-xl12 {
margin-left: 100%;
}
.row .col.pull-xl12 {
right: 100%;
}
.row .col.push-xl12 {
left: 100%;
}
@ -4348,14 +4503,17 @@ nav .brand-logo.center {
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
}
nav .brand-logo.left, nav .brand-logo.right {
padding: 0;
-webkit-transform: none;
transform: none;
}
nav .brand-logo.left {
left: 0.5rem;
}
nav .brand-logo.right {
right: 0.5rem;
left: auto;
@ -4475,10 +4633,12 @@ nav .input-field label.active i {
nav.nav-extended .nav-wrapper {
min-height: 64px;
}
nav, nav .nav-wrapper i, nav a.sidenav-trigger, nav a.sidenav-trigger i {
height: 64px;
line-height: 64px;
}
.navbar-fixed {
height: 64px;
}
@ -5118,12 +5278,14 @@ small {
display: -ms-flexbox;
display: flex;
}
.tabs .tab {
-webkit-box-flex: 1;
-webkit-flex-grow: 1;
-ms-flex-positive: 1;
flex-grow: 1;
}
.tabs .tab a {
padding: 0 12px;
}
@ -6107,15 +6269,19 @@ label {
::-webkit-input-placeholder {
color: #d1d1d1;
}
::-moz-placeholder {
color: #d1d1d1;
}
:-ms-input-placeholder {
color: #d1d1d1;
}
::-ms-input-placeholder {
color: #d1d1d1;
}
::placeholder {
color: #d1d1d1;
}
@ -7714,13 +7880,16 @@ input[type=range]::-ms-thumb {
-webkit-transform: translateX(-105%);
transform: translateX(-105%);
}
.sidenav.sidenav-fixed.right-aligned {
-webkit-transform: translateX(105%);
transform: translateX(105%);
}
.sidenav > a {
padding: 0 16px;
}
.sidenav .user-view {
padding: 16px 16px 0;
}
@ -8486,10 +8655,19 @@ input[type=range]::-ms-thumb {
visibility: visible;
-webkit-animation: pulse-animation 1s cubic-bezier(0.24, 0, 0.38, 1) infinite;
animation: pulse-animation 1s cubic-bezier(0.24, 0, 0.38, 1) infinite;
-webkit-transition: opacity .3s, visibility 0s 1s, -webkit-transform .3s;
transition: opacity .3s, visibility 0s 1s, -webkit-transform .3s;
transition: opacity .3s, transform .3s, visibility 0s 1s;
transition: opacity .3s, transform .3s, visibility 0s 1s, -webkit-transform .3s;
-webkit-transition: opacity .3s,
visibility 0s 1s,
-webkit-transform .3s;
transition: opacity .3s,
visibility 0s 1s,
-webkit-transform .3s;
transition: opacity .3s,
transform .3s,
visibility 0s 1s;
transition: opacity .3s,
transform .3s,
visibility 0s 1s,
-webkit-transform .3s;
}
.tap-target {
@ -8542,10 +8720,19 @@ input[type=range]::-ms-thumb {
.tap-target-wave::after {
visibility: hidden;
-webkit-transition: opacity .3s, visibility 0s, -webkit-transform .3s;
transition: opacity .3s, visibility 0s, -webkit-transform .3s;
transition: opacity .3s, transform .3s, visibility 0s;
transition: opacity .3s, transform .3s, visibility 0s, -webkit-transform .3s;
-webkit-transition: opacity .3s,
visibility 0s,
-webkit-transform .3s;
transition: opacity .3s,
visibility 0s,
-webkit-transform .3s;
transition: opacity .3s,
transform .3s,
visibility 0s;
transition: opacity .3s,
transform .3s,
visibility 0s,
-webkit-transform .3s;
z-index: -1;
}
@ -8823,6 +9010,7 @@ input[type=range]::-ms-thumb {
.datepicker-modal {
max-width: 625px;
}
.datepicker-container.modal-content {
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
@ -8830,17 +9018,20 @@ input[type=range]::-ms-thumb {
-ms-flex-direction: row;
flex-direction: row;
}
.datepicker-date-display {
-webkit-box-flex: 0;
-webkit-flex: 0 1 270px;
-ms-flex: 0 1 270px;
flex: 0 1 270px;
}
.datepicker-controls,
.datepicker-table,
.datepicker-footer {
width: 320px;
}
.datepicker-day-button {
line-height: 44px;
}
@ -9047,6 +9238,7 @@ input[type=range]::-ms-thumb {
.timepicker-modal {
max-width: 600px;
}
.timepicker-container.modal-content {
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
@ -9054,9 +9246,11 @@ input[type=range]::-ms-thumb {
-ms-flex-direction: row;
flex-direction: row;
}
.timepicker-text-container {
top: 32%;
}
.timepicker-display-am-pm {
position: relative;
right: auto;

View File

@ -9,7 +9,8 @@ var _WINDOW = {};
try {
if (typeof window !== 'undefined') _WINDOW = window;
} catch (e) {}
} catch (e) {
}
var _ref = _WINDOW.navigator || {};
var _ref$userAgent = _ref.userAgent;
@ -18,21 +19,11 @@ var userAgent = _ref$userAgent === undefined ? '' : _ref$userAgent;
var WINDOW = _WINDOW;
var IS_IE = ~userAgent.indexOf('MSIE') || ~userAgent.indexOf('Trident/');
var NAMESPACE_IDENTIFIER = '___FONT_AWESOME___';
var PRODUCTION = function () {
try {
return "production" === 'production';
@ -45,7 +36,6 @@ var oneToTen = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
var oneToTwenty = oneToTen.concat([11, 12, 13, 14, 15, 16, 17, 18, 19, 20]);
var RESERVED_CLASSES = ['xs', 'sm', 'lg', 'fw', 'ul', 'li', 'border', 'pull-left', 'pull-right', 'spin', 'pulse', 'rotate-90', 'rotate-180', 'rotate-270', 'flip-horizontal', 'flip-vertical', 'stack', 'stack-1x', 'stack-2x', 'inverse', 'layers', 'layers-text', 'layers-counter'].concat(oneToTen.map(function (n) {
return n + 'x';
})).concat(oneToTwenty.map(function (n) {
@ -511,7 +501,8 @@ var _WINDOW = {};
try {
if (typeof window !== 'undefined') _WINDOW = window;
} catch (e) {}
} catch (e) {
}
var _ref = _WINDOW.navigator || {};
var _ref$userAgent = _ref.userAgent;
@ -520,21 +511,11 @@ var userAgent = _ref$userAgent === undefined ? '' : _ref$userAgent;
var WINDOW = _WINDOW;
var IS_IE = ~userAgent.indexOf('MSIE') || ~userAgent.indexOf('Trident/');
var NAMESPACE_IDENTIFIER = '___FONT_AWESOME___';
var PRODUCTION = function () {
try {
return "production" === 'production';
@ -547,7 +528,6 @@ var oneToTen = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
var oneToTwenty = oneToTen.concat([11, 12, 13, 14, 15, 16, 17, 18, 19, 20]);
var RESERVED_CLASSES = ['xs', 'sm', 'lg', 'fw', 'ul', 'li', 'border', 'pull-left', 'pull-right', 'spin', 'pulse', 'rotate-90', 'rotate-180', 'rotate-270', 'flip-horizontal', 'flip-vertical', 'stack', 'stack-1x', 'stack-2x', 'inverse', 'layers', 'layers-text', 'layers-counter'].concat(oneToTen.map(function (n) {
return n + 'x';
})).concat(oneToTwenty.map(function (n) {
@ -784,7 +764,8 @@ var _WINDOW = {};
try {
if (typeof window !== 'undefined') _WINDOW = window;
} catch (e) {}
} catch (e) {
}
var _ref = _WINDOW.navigator || {};
var _ref$userAgent = _ref.userAgent;
@ -793,21 +774,11 @@ var userAgent = _ref$userAgent === undefined ? '' : _ref$userAgent;
var WINDOW = _WINDOW;
var IS_IE = ~userAgent.indexOf('MSIE') || ~userAgent.indexOf('Trident/');
var NAMESPACE_IDENTIFIER = '___FONT_AWESOME___';
var PRODUCTION = function () {
try {
return "production" === 'production';
@ -820,7 +791,6 @@ var oneToTen = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
var oneToTwenty = oneToTen.concat([11, 12, 13, 14, 15, 16, 17, 18, 19, 20]);
var RESERVED_CLASSES = ['xs', 'sm', 'lg', 'fw', 'ul', 'li', 'border', 'pull-left', 'pull-right', 'spin', 'pulse', 'rotate-90', 'rotate-180', 'rotate-270', 'flip-horizontal', 'flip-vertical', 'stack', 'stack-1x', 'stack-2x', 'inverse', 'layers', 'layers-text', 'layers-counter'].concat(oneToTen.map(function (n) {
return n + 'x';
})).concat(oneToTwenty.map(function (n) {
@ -1712,7 +1682,8 @@ bunker(function () {
(function () {
'use strict';
var noop = function noop() {};
var noop = function noop() {
};
var _WINDOW = {};
var _DOCUMENT = {};
@ -1724,7 +1695,8 @@ try {
if (typeof document !== 'undefined') _DOCUMENT = document;
if (typeof MutationObserver !== 'undefined') _MUTATION_OBSERVER$1 = MutationObserver;
if (typeof performance !== 'undefined') _PERFORMANCE = performance;
} catch (e) {}
} catch (e) {
}
var _ref = _WINDOW.navigator || {};
var _ref$userAgent = _ref.userAgent;
@ -1792,7 +1764,6 @@ var createClass = function () {
}();
var _extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
@ -1808,7 +1779,6 @@ var _extends = Object.assign || function (target) {
};
var slicedToArray = function () {
function sliceIterator(arr, i) {
var _arr = [];
@ -2155,7 +2125,14 @@ var makeIconMasking = function (_ref) {
children: [{tag: 'clipPath', attributes: {id: clipId}, children: [maskPath]}, maskTag]
};
children.push(defs, { tag: 'rect', attributes: _extends({ fill: 'currentColor', 'clip-path': 'url(#' + clipId + ')', mask: 'url(#' + maskId + ')' }, ALL_SPACE) });
children.push(defs, {
tag: 'rect',
attributes: _extends({
fill: 'currentColor',
'clip-path': 'url(#' + clipId + ')',
mask: 'url(#' + maskId + ')'
}, ALL_SPACE)
});
return {
children: children,
@ -2289,7 +2266,11 @@ function makeInlineSvgAbstract(params) {
content.attributes[DATA_FA_I2SVG] = '';
}
if (title) content.children.push({ tag: 'title', attributes: { id: content.attributes['aria-labelledby'] || 'title-' + nextUniqueId() }, children: [title] });
if (title) content.children.push({
tag: 'title',
attributes: {id: content.attributes['aria-labelledby'] || 'title-' + nextUniqueId()},
children: [title]
});
var args = _extends({}, content, {
prefix: prefix,
@ -2337,7 +2318,12 @@ function makeLayersTextAbstract(params) {
var styles = _extends({}, extra.styles);
if (transformIsMeaningful(transform)) {
styles['transform'] = transformForCss({ transform: transform, startCentered: true, width: width, height: height });
styles['transform'] = transformForCss({
transform: transform,
startCentered: true,
width: width,
height: height
});
styles['-webkit-transform'] = styles['transform'];
}
@ -2393,8 +2379,12 @@ function makeLayersCounterAbstract(params) {
return val;
}
var noop$2 = function noop() {};
var p = config.measurePerformance && PERFORMANCE && PERFORMANCE.mark && PERFORMANCE.measure ? PERFORMANCE : { mark: noop$2, measure: noop$2 };
var noop$2 = function noop() {
};
var p = config.measurePerformance && PERFORMANCE && PERFORMANCE.mark && PERFORMANCE.measure ? PERFORMANCE : {
mark: noop$2,
measure: noop$2
};
var preamble = 'FA "5.3.1"';
var begin = function begin(name) {
@ -2426,7 +2416,6 @@ var bindInternal4 = function bindInternal4 (func, thisContext) {
'use strict';
/**
* # Reduce
*
@ -2447,8 +2436,7 @@ var reduce = function fastReduceObject (subject, fn, initialValue, thisContext)
if (initialValue === undefined) {
i = 1;
result = subject[keys[0]];
}
else {
} else {
i = 0;
result = initialValue;
}
@ -2577,7 +2565,8 @@ function toHtml(abstractNodes) {
}
}
var noop$1 = function noop() {};
var noop$1 = function noop() {
};
function isWatched(node) {
var i2svg = node.getAttribute ? node.getAttribute(DATA_FA_I2SVG) : null;
@ -2967,7 +2956,10 @@ var DOT = {
cy: '364',
r: '28'
}),
children: [{ tag: 'animate', attributes: _extends({}, ANIMATION_BASE, { attributeName: 'r', values: '28;14;28;28;14;28;' }) }, { tag: 'animate', attributes: _extends({}, OPACITY_ANIMATE, { values: '1;0;1;1;0;1;' }) }]
children: [{
tag: 'animate',
attributes: _extends({}, ANIMATION_BASE, {attributeName: 'r', values: '28;14;28;28;14;28;'})
}, {tag: 'animate', attributes: _extends({}, OPACITY_ANIMATE, {values: '1;0;1;1;0;1;'})}]
};
var QUESTION = {
tag: 'path',
@ -3435,7 +3427,8 @@ var dom = {
var _params$node = params.node,
node = _params$node === undefined ? DOCUMENT : _params$node,
_params$callback = params.callback,
callback = _params$callback === undefined ? function () {} : _params$callback;
callback = _params$callback === undefined ? function () {
} : _params$callback;
if (config.searchPseudoElements) {

View File

@ -14,12 +14,19 @@ var GitHubActivity = (function() {
var methods = {
renderLink: function (url, title, cssClass) {
if (!title) { title = url; }
if (!title) {
title = url;
}
if (typeof (cssClass) === 'undefined') cssClass = "";
return Mustache.render('<a class="' + cssClass + '" href="{{url}}" target="_blank">{{{title}}}</a>', { url: url, title: title });
return Mustache.render('<a class="' + cssClass + '" href="{{url}}" target="_blank">{{{title}}}</a>', {
url: url,
title: title
});
},
renderGitHubLink: function (url, title, cssClass) {
if (!title) { title = url; }
if (!title) {
title = url;
}
if (typeof (cssClass) === 'undefined') cssClass = "";
return methods.renderLink('https://github.com/' + url, title, cssClass);
},
@ -44,10 +51,17 @@ var GitHubActivity = (function() {
var length = p.commits.length;
if (length === 2) {
// If there are 2 commits, show message 'View comparison for these 2 commits >>'
data.commitsMessage = Mustache.render('<a href="https://github.com/{{repo}}/compare/{{shaDiff}}">View comparison for these 2 commits &raquo;</a>', { repo: data.repo.name, shaDiff: shaDiff });
data.commitsMessage = Mustache.render('<a href="https://github.com/{{repo}}/compare/{{shaDiff}}">View comparison for these 2 commits &raquo;</a>', {
repo: data.repo.name,
shaDiff: shaDiff
});
} else if (length > 2) {
// If there are more than two, show message '(numberOfCommits - 2) more commits >>'
data.commitsMessage = Mustache.render('<a href="https://github.com/{{repo}}/compare/{{shaDiff}}">{{length}} more ' + pluralize('commit', length - 2) + ' &raquo;</a>', { repo: data.repo.name, shaDiff: shaDiff, length: p.size - 2 });
data.commitsMessage = Mustache.render('<a href="https://github.com/{{repo}}/compare/{{shaDiff}}">{{length}} more ' + pluralize('commit', length - 2) + ' &raquo;</a>', {
repo: data.repo.name,
shaDiff: shaDiff,
length: p.size - 2
});
}
p.commits.forEach(function (d, i) {
@ -85,7 +99,11 @@ var GitHubActivity = (function() {
if (p.pull_request.merged) {
p.action = "merged";
var message = '{{c}} ' + pluralize('commit', pr.commits) + ' with {{a}} ' + pluralize('addition', pr.additions) + ' and {{d}} ' + pluralize('deletion', pr.deletions);
data.mergeMessage = Mustache.render('<br><small class="gha-message-merge">' + message + '</small>', { c: pr.commits, a: pr.additions, d: pr.deletions });
data.mergeMessage = Mustache.render('<br><small class="gha-message-merge">' + message + '</small>', {
c: pr.commits,
a: pr.additions,
d: pr.deletions
});
}
}
@ -139,7 +157,12 @@ var GitHubActivity = (function() {
} else {
icon = icons[data.type]
}
var activity = { message: message, icon: icon, timeString: timeString, userLink: methods.renderGitHubLink(data.actor.login) };
var activity = {
message: message,
icon: icon,
timeString: timeString,
userLink: methods.renderGitHubLink(data.actor.login)
};
if (singleLineActivities.indexOf(data.type) > -1) {
return Mustache.render(templates.SingleLineActivity, activity);
@ -190,7 +213,9 @@ var GitHubActivity = (function() {
}
};
request.onerror = function() { callback('An error occurred connecting to ' + url); };
request.onerror = function () {
callback('An error occurred connecting to ' + url);
};
request.send();
},
renderStream: function (output, div) {
@ -280,6 +305,7 @@ function millisecondsToStr(milliseconds) {
function numberEnding(number) {
return (number > 1) ? 's ago' : ' ago';
}
var temp = Math.floor(milliseconds / 1000);
var years = Math.floor(temp / 31536000);
@ -312,7 +338,162 @@ function pluralize(word, number) {
}
/** MD5 methods written by Joseph Myers. http://www.myersdaily.org/joseph/javascript/md5-text.html */
function md5cycle(f,h){var g=f[0],e=f[1],j=f[2],i=f[3];g=ff(g,e,j,i,h[0],7,-680876936);i=ff(i,g,e,j,h[1],12,-389564586);j=ff(j,i,g,e,h[2],17,606105819);e=ff(e,j,i,g,h[3],22,-1044525330);g=ff(g,e,j,i,h[4],7,-176418897);i=ff(i,g,e,j,h[5],12,1200080426);j=ff(j,i,g,e,h[6],17,-1473231341);e=ff(e,j,i,g,h[7],22,-45705983);g=ff(g,e,j,i,h[8],7,1770035416);i=ff(i,g,e,j,h[9],12,-1958414417);j=ff(j,i,g,e,h[10],17,-42063);e=ff(e,j,i,g,h[11],22,-1990404162);g=ff(g,e,j,i,h[12],7,1804603682);i=ff(i,g,e,j,h[13],12,-40341101);j=ff(j,i,g,e,h[14],17,-1502002290);e=ff(e,j,i,g,h[15],22,1236535329);g=gg(g,e,j,i,h[1],5,-165796510);i=gg(i,g,e,j,h[6],9,-1069501632);j=gg(j,i,g,e,h[11],14,643717713);e=gg(e,j,i,g,h[0],20,-373897302);g=gg(g,e,j,i,h[5],5,-701558691);i=gg(i,g,e,j,h[10],9,38016083);j=gg(j,i,g,e,h[15],14,-660478335);e=gg(e,j,i,g,h[4],20,-405537848);g=gg(g,e,j,i,h[9],5,568446438);i=gg(i,g,e,j,h[14],9,-1019803690);j=gg(j,i,g,e,h[3],14,-187363961);e=gg(e,j,i,g,h[8],20,1163531501);g=gg(g,e,j,i,h[13],5,-1444681467);i=gg(i,g,e,j,h[2],9,-51403784);j=gg(j,i,g,e,h[7],14,1735328473);e=gg(e,j,i,g,h[12],20,-1926607734);g=hh(g,e,j,i,h[5],4,-378558);i=hh(i,g,e,j,h[8],11,-2022574463);j=hh(j,i,g,e,h[11],16,1839030562);e=hh(e,j,i,g,h[14],23,-35309556);g=hh(g,e,j,i,h[1],4,-1530992060);i=hh(i,g,e,j,h[4],11,1272893353);j=hh(j,i,g,e,h[7],16,-155497632);e=hh(e,j,i,g,h[10],23,-1094730640);g=hh(g,e,j,i,h[13],4,681279174);i=hh(i,g,e,j,h[0],11,-358537222);j=hh(j,i,g,e,h[3],16,-722521979);e=hh(e,j,i,g,h[6],23,76029189);g=hh(g,e,j,i,h[9],4,-640364487);i=hh(i,g,e,j,h[12],11,-421815835);j=hh(j,i,g,e,h[15],16,530742520);e=hh(e,j,i,g,h[2],23,-995338651);g=ii(g,e,j,i,h[0],6,-198630844);i=ii(i,g,e,j,h[7],10,1126891415);j=ii(j,i,g,e,h[14],15,-1416354905);e=ii(e,j,i,g,h[5],21,-57434055);g=ii(g,e,j,i,h[12],6,1700485571);i=ii(i,g,e,j,h[3],10,-1894986606);j=ii(j,i,g,e,h[10],15,-1051523);e=ii(e,j,i,g,h[1],21,-2054922799);g=ii(g,e,j,i,h[8],6,1873313359);i=ii(i,g,e,j,h[15],10,-30611744);j=ii(j,i,g,e,h[6],15,-1560198380);e=ii(e,j,i,g,h[13],21,1309151649);g=ii(g,e,j,i,h[4],6,-145523070);i=ii(i,g,e,j,h[11],10,-1120210379);j=ii(j,i,g,e,h[2],15,718787259);e=ii(e,j,i,g,h[9],21,-343485551);f[0]=add32(g,f[0]);f[1]=add32(e,f[1]);f[2]=add32(j,f[2]);f[3]=add32(i,f[3])}function cmn(h,e,d,c,g,f){e=add32(add32(e,h),add32(c,f));return add32((e<<g)|(e>>>(32-g)),d)}function ff(g,f,k,j,e,i,h){return cmn((f&k)|((~f)&j),g,f,e,i,h)}function gg(g,f,k,j,e,i,h){return cmn((f&j)|(k&(~j)),g,f,e,i,h)}function hh(g,f,k,j,e,i,h){return cmn(f^k^j,g,f,e,i,h)}function ii(g,f,k,j,e,i,h){return cmn(k^(f|(~j)),g,f,e,i,h)}function md51(c){txt="";var e=c.length,d=[1732584193,-271733879,-1732584194,271733878],b;for(b=64;b<=c.length;b+=64){md5cycle(d,md5blk(c.substring(b-64,b)))}c=c.substring(b-64);var a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(b=0;b<c.length;b++){a[b>>2]|=c.charCodeAt(b)<<((b%4)<<3)}a[b>>2]|=128<<((b%4)<<3);if(b>55){md5cycle(d,a);for(b=0;b<16;b++){a[b]=0}}a[14]=e*8;md5cycle(d,a);return d}function md5blk(b){var c=[],a;for(a=0;a<64;a+=4){c[a>>2]=b.charCodeAt(a)+(b.charCodeAt(a+1)<<8)+(b.charCodeAt(a+2)<<16)+(b.charCodeAt(a+3)<<24)}return c}var hex_chr="0123456789abcdef".split("");function rhex(c){var b="",a=0;for(;a<4;a++){b+=hex_chr[(c>>(a*8+4))&15]+hex_chr[(c>>(a*8))&15]}return b}function hex(a){for(var b=0;b<a.length;b++){a[b]=rhex(a[b])}return a.join("")}function md5(a){return hex(md51(a))}function add32(d,c){return(d+c)&4294967295}if(md5("hello")!="5d41402abc4b2a76b9719d911017c592"){function add32(a,d){var c=(a&65535)+(d&65535),b=(a>>16)+(d>>16)+(c>>16);return(b<<16)|(c&65535)}};
function md5cycle(f, h) {
var g = f[0], e = f[1], j = f[2], i = f[3];
g = ff(g, e, j, i, h[0], 7, -680876936);
i = ff(i, g, e, j, h[1], 12, -389564586);
j = ff(j, i, g, e, h[2], 17, 606105819);
e = ff(e, j, i, g, h[3], 22, -1044525330);
g = ff(g, e, j, i, h[4], 7, -176418897);
i = ff(i, g, e, j, h[5], 12, 1200080426);
j = ff(j, i, g, e, h[6], 17, -1473231341);
e = ff(e, j, i, g, h[7], 22, -45705983);
g = ff(g, e, j, i, h[8], 7, 1770035416);
i = ff(i, g, e, j, h[9], 12, -1958414417);
j = ff(j, i, g, e, h[10], 17, -42063);
e = ff(e, j, i, g, h[11], 22, -1990404162);
g = ff(g, e, j, i, h[12], 7, 1804603682);
i = ff(i, g, e, j, h[13], 12, -40341101);
j = ff(j, i, g, e, h[14], 17, -1502002290);
e = ff(e, j, i, g, h[15], 22, 1236535329);
g = gg(g, e, j, i, h[1], 5, -165796510);
i = gg(i, g, e, j, h[6], 9, -1069501632);
j = gg(j, i, g, e, h[11], 14, 643717713);
e = gg(e, j, i, g, h[0], 20, -373897302);
g = gg(g, e, j, i, h[5], 5, -701558691);
i = gg(i, g, e, j, h[10], 9, 38016083);
j = gg(j, i, g, e, h[15], 14, -660478335);
e = gg(e, j, i, g, h[4], 20, -405537848);
g = gg(g, e, j, i, h[9], 5, 568446438);
i = gg(i, g, e, j, h[14], 9, -1019803690);
j = gg(j, i, g, e, h[3], 14, -187363961);
e = gg(e, j, i, g, h[8], 20, 1163531501);
g = gg(g, e, j, i, h[13], 5, -1444681467);
i = gg(i, g, e, j, h[2], 9, -51403784);
j = gg(j, i, g, e, h[7], 14, 1735328473);
e = gg(e, j, i, g, h[12], 20, -1926607734);
g = hh(g, e, j, i, h[5], 4, -378558);
i = hh(i, g, e, j, h[8], 11, -2022574463);
j = hh(j, i, g, e, h[11], 16, 1839030562);
e = hh(e, j, i, g, h[14], 23, -35309556);
g = hh(g, e, j, i, h[1], 4, -1530992060);
i = hh(i, g, e, j, h[4], 11, 1272893353);
j = hh(j, i, g, e, h[7], 16, -155497632);
e = hh(e, j, i, g, h[10], 23, -1094730640);
g = hh(g, e, j, i, h[13], 4, 681279174);
i = hh(i, g, e, j, h[0], 11, -358537222);
j = hh(j, i, g, e, h[3], 16, -722521979);
e = hh(e, j, i, g, h[6], 23, 76029189);
g = hh(g, e, j, i, h[9], 4, -640364487);
i = hh(i, g, e, j, h[12], 11, -421815835);
j = hh(j, i, g, e, h[15], 16, 530742520);
e = hh(e, j, i, g, h[2], 23, -995338651);
g = ii(g, e, j, i, h[0], 6, -198630844);
i = ii(i, g, e, j, h[7], 10, 1126891415);
j = ii(j, i, g, e, h[14], 15, -1416354905);
e = ii(e, j, i, g, h[5], 21, -57434055);
g = ii(g, e, j, i, h[12], 6, 1700485571);
i = ii(i, g, e, j, h[3], 10, -1894986606);
j = ii(j, i, g, e, h[10], 15, -1051523);
e = ii(e, j, i, g, h[1], 21, -2054922799);
g = ii(g, e, j, i, h[8], 6, 1873313359);
i = ii(i, g, e, j, h[15], 10, -30611744);
j = ii(j, i, g, e, h[6], 15, -1560198380);
e = ii(e, j, i, g, h[13], 21, 1309151649);
g = ii(g, e, j, i, h[4], 6, -145523070);
i = ii(i, g, e, j, h[11], 10, -1120210379);
j = ii(j, i, g, e, h[2], 15, 718787259);
e = ii(e, j, i, g, h[9], 21, -343485551);
f[0] = add32(g, f[0]);
f[1] = add32(e, f[1]);
f[2] = add32(j, f[2]);
f[3] = add32(i, f[3])
}
function cmn(h, e, d, c, g, f) {
e = add32(add32(e, h), add32(c, f));
return add32((e << g) | (e >>> (32 - g)), d)
}
function ff(g, f, k, j, e, i, h) {
return cmn((f & k) | ((~f) & j), g, f, e, i, h)
}
function gg(g, f, k, j, e, i, h) {
return cmn((f & j) | (k & (~j)), g, f, e, i, h)
}
function hh(g, f, k, j, e, i, h) {
return cmn(f ^ k ^ j, g, f, e, i, h)
}
function ii(g, f, k, j, e, i, h) {
return cmn(k ^ (f | (~j)), g, f, e, i, h)
}
function md51(c) {
txt = "";
var e = c.length, d = [1732584193, -271733879, -1732584194, 271733878], b;
for (b = 64; b <= c.length; b += 64) {
md5cycle(d, md5blk(c.substring(b - 64, b)))
}
c = c.substring(b - 64);
var a = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
for (b = 0; b < c.length; b++) {
a[b >> 2] |= c.charCodeAt(b) << ((b % 4) << 3)
}
a[b >> 2] |= 128 << ((b % 4) << 3);
if (b > 55) {
md5cycle(d, a);
for (b = 0; b < 16; b++) {
a[b] = 0
}
}
a[14] = e * 8;
md5cycle(d, a);
return d
}
function md5blk(b) {
var c = [], a;
for (a = 0; a < 64; a += 4) {
c[a >> 2] = b.charCodeAt(a) + (b.charCodeAt(a + 1) << 8) + (b.charCodeAt(a + 2) << 16) + (b.charCodeAt(a + 3) << 24)
}
return c
}
var hex_chr = "0123456789abcdef".split("");
function rhex(c) {
var b = "", a = 0;
for (; a < 4; a++) {
b += hex_chr[(c >> (a * 8 + 4)) & 15] + hex_chr[(c >> (a * 8)) & 15]
}
return b
}
function hex(a) {
for (var b = 0; b < a.length; b++) {
a[b] = rhex(a[b])
}
return a.join("")
}
function md5(a) {
return hex(md51(a))
}
function add32(d, c) {
return (d + c) & 4294967295
}
if (md5("hello") != "5d41402abc4b2a76b9719d911017c592") {
function add32(a, d) {
var c = (a & 65535) + (d & 65535), b = (a >> 16) + (d >> 16) + (c >> 16);
return (b << 16) | (c & 65535)
}
}
;
var templates = {
Stream: '<div class="gha-feed">{{{text}}}<div class="gha-push-small"></div>{{{footer}}}</div>',

View File

@ -64,7 +64,8 @@
if (/^[\{\[]/.test(result)) {
value = result;
}
} catch (e) {}
} catch (e) {
}
if (!converter.write) {
value = encodeURIComponent(String(value))
@ -122,7 +123,8 @@
if (this.json) {
try {
cookie = JSON.parse(cookie);
} catch (e) {}
} catch (e) {
}
}
if (key === name) {
@ -133,7 +135,8 @@
if (!key) {
result[name] = cookie;
}
} catch (e) {}
} catch (e) {
}
}
return result;
@ -161,5 +164,6 @@
return api;
}
return init(function () {});
return init(function () {
});
}));

View File

@ -1,5 +1,3 @@
var input_name;
var input_psw;
var btn_submit;
@ -20,8 +18,7 @@ $(document).ready(() => {
input_name.on("input", function () {
if (input_name.val() !== "" && input_psw.val() !== "") {
popInSubmit();
}else
{
} else {
popOutSubmit();
}
});
@ -29,21 +26,15 @@ $(document).ready(() => {
input_psw.on("input", function () {
if (input_name.val() !== "" && input_psw.val() !== "") {
popInSubmit();
}else
{
} else {
popOutSubmit();
}
});
});
function popOutSubmit() {
if (btn_submit.hasClass("scale-in")) {
btn_submit.removeClass("scale-in");
@ -59,11 +50,6 @@ function popInSubmit(){
}
function tryConnection() {
var request = {name: input_name.val(), password: input_psw.val()};

File diff suppressed because it is too large Load Diff

View File

@ -89,8 +89,7 @@ function getCurentMusic() {
enableBtn(btn_play);
enableBtn(btn_next);
enableBtn(btn_disconnect_music);
}
else {
} else {
disableBtn(btn_play);
disableBtn(btn_stop);
disableBtn(btn_info);
@ -190,9 +189,7 @@ function getCurentMusic() {
musicLoadFlag = false;
}
}
}
else {
} else {
if (loadingFlag) {
modal_loading.close();
loadingFlag = false;
@ -252,8 +249,7 @@ function getPlayList(data) {
sendCommand(command, true);
});
}
}
else {
} else {
$('#playlist_list').empty();
savedPlaylist = {};
}
@ -263,8 +259,6 @@ function getPlayList(data) {
}
}
function getChannels() {
@ -329,8 +323,7 @@ function updateControl(data) {
enableBtn(btn_flush);
enableBtn(btn_next);
enableBtn(btn_disconnect_music);
}
else {
} else {
disableBtn(btn_play);
disableBtn(btn_stop);
disableBtn(btn_info);
@ -345,7 +338,6 @@ function updateControl(data) {
}
$('#music_img').attr("src", "https://img.youtube.com/vi/" + data.info.audioTrackInfo.identifier + "/hqdefault.jpg");
$('#total_time').text(msToTime(data.info.audioTrackInfo.length));
$('#current_time').text(msToTime(data.currentPos));
@ -392,8 +384,7 @@ function sendCommand(command, modal) {
Cookies.remove('token');
Cookies.remove('name');
location.reload();
}
else {
} else {
M.toast({
html: " <i class=\"material-icons\" style='margin-right: 10px'>warning</i> Command fail!",
classes: 'red',
@ -489,8 +480,7 @@ function addListClick(event) {
let button;
if (event.target.nodeName === "I") {
button = event.target.parentNode;
}
else
} else
button = event.target;
button.classList.add("scale-out");
@ -587,8 +577,7 @@ function listeners() {
$('#input_search').on("input", function () {
if ($('#input_search').val() == "") {
disableBtn($('#btn_search'));
}
else {
} else {
enableBtn($('#btn_search'));
}
});
@ -623,8 +612,7 @@ function listeners() {
switchAutoFlow.click(function () {
if (switchAutoFlow.is(':checked')) {
sendCommand({command: 'AUTOFLOWON'}, false)
}
else
} else
sendCommand({command: 'AUTOFLOWOFF'}, false)
});
}

View File

@ -5,8 +5,6 @@ var btn_disconnect;
var nav_name;
$(document).ready(function () {
$('.tooltipped').tooltip();
@ -19,9 +17,6 @@ $(document).ready(function() {
});
nav_bar_account_link = $("#nav-bar-account");
btn_disconnect = $(".nav-disconnect");
nav_name = $("#nav-name");
@ -34,15 +29,13 @@ $(document).ready(function() {
});
function connected() {
console.log("Connected!");
console.log("Checking token...");
console.log(window.location.href);
if (!window.location.href.includes("oauthCallback")) {
checkToken();
}
else{
} else {
console.log("Oauth page skip check token");
}
@ -60,9 +53,6 @@ function disconnected() {
}
function navListeners() {
btn_disconnect.click(function () {
@ -106,9 +96,7 @@ function getGuild(){
window.location.replace("/");
if (data.length === 0) {
return;
}
else if(data.length === 1){
} else if (data.length === 1) {
Cookies.set('guild', data[0].id, {expires: 31});
window.location.reload(true);
}
@ -146,8 +134,7 @@ function checkConnection() {
if (Cookies.get('token') === undefined) {
disconnected()
}
else{
} else {
connected();
}
@ -208,6 +195,4 @@ function checkToken() {
});
}

View File

@ -1,4 +1,3 @@
var hash = window.location.hash.replace("#", "").split("&");
var discordToken = "";

View File

@ -1,4 +1,3 @@
var ok_passwrd = false;
$(document).ready(function () {
var baseUrl = window.location.protocol + "//" + window.location.host + window.location.pathname;
@ -13,8 +12,7 @@ $(document).ready(function() {
sendBtn.removeClass("scale-in");
sendBtn.addClass("scale-out");
}
}
else{
} else {
if (sendBtn.hasClass("scale-out") && ok_passwrd) {
sendBtn.removeClass("scale-out");
sendBtn.addClass("scale-in");
@ -42,8 +40,7 @@ $(document).ready(function() {
}
}
ok_passwrd = true;
}
else{
} else {
if (!passwrd.hasClass("invalid")) {
passwrd.addClass("invalid");
passwrd.removeClass("valid");
@ -75,8 +72,7 @@ $(document).ready(function() {
}
}
ok_passwrd = true;
}
else{
} else {
if (!passwrd.hasClass("invalid")) {
passwrd.addClass("invalid");
passwrd.removeClass("valid");
@ -115,8 +111,7 @@ $(document).ready(function() {
$('#name').addClass("invalid");
$('#name').removeClass("valid");
}
else{
} else {
alert(data.responseJSON.message);
}
@ -136,8 +131,7 @@ $(document).ready(function() {
sendBtn.removeClass("scale-in");
sendBtn.addClass("scale-out");
}
}
else{
} else {
if (sendBtn.hasClass("scale-out")) {
sendBtn.removeClass("scale-out");
sendBtn.addClass("scale-in");

View File

@ -1,7 +1,6 @@
var post_json = {settings: []};
$(document).ready(function () {
$('select').formSelect();
@ -62,12 +61,18 @@ $(document).ready(function(){
}).done(function (data) {
console.log("ok");
M.toast({html: '<i class="small material-icons" style="margin-right: 0.3em">done</i>Save Successful ! ', classes: 'rounded green'});
M.toast({
html: '<i class="small material-icons" style="margin-right: 0.3em">done</i>Save Successful ! ',
classes: 'rounded green'
});
modal_loading.modal('close');
}).fail(function (data) {
console.log(data);
modal_loading.modal('close');
M.toast({html: '<i class="small material-icons" style="margin-right: 0.3em">report</i>Save Failed ! ', classes: 'rounded red'});
M.toast({
html: '<i class="small material-icons" style="margin-right: 0.3em">report</i>Save Failed ! ',
classes: 'rounded red'
});
});

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<!-- created with Free Online Sitemap Generator www.xml-sitemaps.com -->

View File

@ -1,19 +1,19 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0"/>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<meta content="width=device-width, initial-scale=1, maximum-scale=1.0" name="viewport"/>
<title>Claptrap Bot</title>
<link rel="icon"
type="image/x-icon"
href="/favicon.png"/>
<link href="/favicon.png"
rel="icon"
type="image/x-icon"/>
<!-- CSS -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"/>
<link href="css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<link href="css/style.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<link rel="manifest" href="/manifest.json"/>
<meta name="theme-color" content="#263238"/>
<link href="css/materialize.css" media="screen,projection" rel="stylesheet" type="text/css"/>
<link href="css/style.css" media="screen,projection" rel="stylesheet" type="text/css"/>
<link href="/manifest.json" rel="manifest"/>
<meta content="#263238" name="theme-color"/>
<style>
@media only screen and (max-width: 992px) {
.row.valign-wrapper {

View File

@ -1,19 +1,19 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0"/>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<meta content="width=device-width, initial-scale=1, maximum-scale=1.0" name="viewport"/>
<title>Claptrap Bot</title>
<link rel="icon"
type="image/x-icon"
href="/favicon.png"/>
<link href="/favicon.png"
rel="icon"
type="image/x-icon"/>
<!-- CSS -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"/>
<link href="/css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<link href="/css/style.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<link rel="manifest" href="/manifest.json"/>
<meta name="theme-color" content="#263238"/>
<link href="/css/materialize.css" media="screen,projection" rel="stylesheet" type="text/css"/>
<link href="/css/style.css" media="screen,projection" rel="stylesheet" type="text/css"/>
<link href="/manifest.json" rel="manifest"/>
<meta content="#263238" name="theme-color"/>
</head>

View File

@ -1,19 +1,19 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0"/>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<meta content="width=device-width, initial-scale=1, maximum-scale=1.0" name="viewport"/>
<title>Claptrap Bot</title>
<link rel="icon"
type="image/x-icon"
href="/favicon.png"/>
<link href="/favicon.png"
rel="icon"
type="image/x-icon"/>
<!-- CSS -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"/>
<link href="css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<link href="css/style.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<link rel="manifest" href="/manifest.json"/>
<meta name="theme-color" content="#263238"/>
<link href="css/materialize.css" media="screen,projection" rel="stylesheet" type="text/css"/>
<link href="css/style.css" media="screen,projection" rel="stylesheet" type="text/css"/>
<link href="/manifest.json" rel="manifest"/>
<meta content="#263238" name="theme-color"/>
<style>
@media only screen and (max-width: 992px) {
.row.valign-wrapper {

View File

@ -6,17 +6,19 @@
</head>
<body>
<link href="../static/css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<link href="../static/css/materialize.css" media="screen,projection" rel="stylesheet" type="text/css"/>
<div class="footer-copyright brown darken-4" th:fragment="footer">
<div class="container center-align">
<a href="https://github.com/Sebclem/ClaptrapBot" style="margin-right: 10px; height: 41px" class="" target="_blank">
<img th:src="@{/img/GitHub.png}" height="41px" alt="Github"/>
<img th:src="@{/img/GitHub_Logo.png}" height="41px" style="margin-left: -3px" alt="Github"/>
<a class="" href="https://github.com/Sebclem/ClaptrapBot" style="margin-right: 10px; height: 41px"
target="_blank">
<img alt="Github" height="41px" th:src="@{/img/GitHub.png}"/>
<img alt="Github" height="41px" style="margin-left: -3px" th:src="@{/img/GitHub_Logo.png}"/>
</a>
<a href="https://www.buymeacoffee.com/seb6596" target="_blank">
<img alt="Buy Me A Coffee" src="https://www.buymeacoffee.com/assets/img/guidelines/download-assets-sm-2.svg"/>
<img alt="Buy Me A Coffee"
src="https://www.buymeacoffee.com/assets/img/guidelines/download-assets-sm-2.svg"/>
</a>
</div>

View File

@ -11,17 +11,23 @@
<!-- AND -->
<!-- LOGIN -->
<!--__________________________________________________________-->
<link href="../static/css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<link href="../static/css/materialize.css" media="screen,projection" rel="stylesheet" type="text/css"/>
<div th:fragment="header (page, guild_name, isAdmin)">
<nav class="brown darken-4 z-depth-3" role="navigation">
<div class="nav-wrapper container">
<a href="/" class="brand-logo hide-on-small-and-down" style="white-space: nowrap">Claptrap Bot</a>
<a href="/" class="brand-logo hide-on-med-and-up show-on-small" style="white-space: nowrap">Claptrap</a>
<a class="brand-logo hide-on-small-and-down" href="/" style="white-space: nowrap">Claptrap Bot</a>
<a class="brand-logo hide-on-med-and-up show-on-small" href="/" style="white-space: nowrap">Claptrap</a>
<ul class="right hide-on-med-and-down">
<li>
<a th:if="${guild_name != ''}" class="truncate waves-effect brown darken-3 waves-light btn-flat grey-text text-darken-1 dropdown-trigger" id="drop-trigger-guilds" data-target="dropdown_guilds" th:inline="text" style="margin-top: 2px;margin-right: 10px;">[[${guild_name}]]<img th:src="${guild_icon}" id="guildLogo" class="brand-logo left circle" style="max-height: 100%; margin-right: 10px; padding: 2px; padding-left: 0"/></a>
<a class="truncate waves-effect brown darken-3 waves-light btn-flat grey-text text-darken-1 dropdown-trigger"
data-target="dropdown_guilds"
id="drop-trigger-guilds" style="margin-top: 2px;margin-right: 10px;" th:if="${guild_name != ''}"
th:inline="text">[[${guild_name}]]<img class="brand-logo left circle"
id="guildLogo"
style="max-height: 100%; margin-right: 10px; padding: 2px; padding-left: 0"
th:src="${guild_icon}"/></a>
</li>
<li class="" th:classappend="(${page} == 'home')? 'active' : ''">
<a class="waves-effect waves-light" href="/">Home</a>
@ -35,28 +41,35 @@
<li id="nav-bar-account">
<a class="dropdown-account dropdown-trigger" data-target="dropdown_connected"><i class="material-icons">account_box</i></a>
<a class="dropdown-account dropdown-trigger" data-target="dropdown_connected"><i
class="material-icons">account_box</i></a>
</li>
</ul>
<a href="#" data-target="nav-mobile" class="sidenav-trigger"><i class="material-icons">menu</i></a>
<a class="sidenav-trigger" data-target="nav-mobile" href="#"><i class="material-icons">menu</i></a>
</div>
</nav>
<ul id="nav-mobile" class="sidenav">
<ul class="sidenav" id="nav-mobile">
<li class="center">
<a class="brand-logo" href="/" style="font-weight: bold"><h3 class="blue-grey-text text-darken-4" style="font-weight: bold">Claptrap</h3></a>
<a class="brand-logo" href="/" style="font-weight: bold"><h3 class="blue-grey-text text-darken-4"
style="font-weight: bold">Claptrap</h3></a>
</li>
<li>
<div class="divider"></div>
</li>
<li><div class="divider"></div></li>
<li class="center ">
<a class="nav-change-guild truncate waves-effect waves-light btn grey lighten-2 black-text " th:text="${guild_name}" style=""></a>
<a class="nav-change-guild truncate waves-effect waves-light btn grey lighten-2 black-text "
style="" th:text="${guild_name}"></a>
</li>
<li>
<div class="divider"></div>
</li>
<li><div class="divider"></div></li>
<li class="center" th:classappend="(${page} == 'home')? 'active' : ''">
<a class="waves-effect waves-light sidenav-trigger" href="/" data-target="slide-out">Home</a>
<a class="waves-effect waves-light sidenav-trigger" data-target="slide-out" href="/">Home</a>
</li>
<li class="center" th:classappend="(${page} == 'music')? 'active' : ''">
<a class="waves-effect waves-light" href="/music">Music Control</a>
@ -66,16 +79,21 @@
</li>
<li><div class="divider"></div></li>
<li>
<div class="divider"></div>
</li>
<li><a class="center nav-change-guild" href="#">Change Server</a></li>
<li class="center bot-settings" th:classappend="(${page} == 'settings')? 'active' : ''" th:style="${isAdmin} ? '' : 'visibility: hidden; display: none;'">
<li class="center bot-settings" th:classappend="(${page} == 'settings')? 'active' : ''"
th:style="${isAdmin} ? '' : 'visibility: hidden; display: none;'">
<a class="waves-effect waves-light" href="/settings">Bot Settings</a>
</li>
<li>
<a class="center tooltipped" data-position="bottom" data-delay="50" data-tooltip="Under Development!">My Account</a>
<a class="center tooltipped" data-delay="50" data-position="bottom" data-tooltip="Under Development!">My
Account</a>
</li>
<li>
<a class="center tooltipped" data-position="bottom" data-delay="50" data-tooltip="Under Development!">My Playlists</a>
<a class="center tooltipped" data-delay="50" data-position="bottom" data-tooltip="Under Development!">My
Playlists</a>
</li>
<li class="divider"></li>
@ -87,8 +105,11 @@
<ul class="dropdown-content" id="dropdown_guilds">
<!--/*@thymesVar id="mutual_guilds" type="java.util.List<net.dv8tion.jda.core.entities.Guild>"*/-->
<th:block th:each="guild : ${mutual_guilds}">
<li style="height: 50px; white-space: nowrap;" th:attr="data-id = ${guild.getId()}" th:if="${guild.getId() != guild_id}" class="guild_change">
<img th:src="${guild.getIconUrl() == null ? 'https://discordapp.com/assets/dd4dbc0016779df1378e7812eabaa04d.png' : guild.getIconUrl()}" class="left circle" style="max-height: 100%; padding: 5px; "/><a class="center blue-grey-text text-darken-4" th:inline="text" style="margin-left: 50px">[[${guild.getName()}]]</a>
<li class="guild_change" style="height: 50px; white-space: nowrap;"
th:attr="data-id = ${guild.getId()}" th:if="${guild.getId() != guild_id}">
<img class="left circle"
style="max-height: 100%; padding: 5px; " th:src="${guild.getIconUrl() == null ? 'https://discordapp.com/assets/dd4dbc0016779df1378e7812eabaa04d.png' : guild.getIconUrl()}"/><a
class="center blue-grey-text text-darken-4" style="margin-left: 50px" th:inline="text">[[${guild.getName()}]]</a>
</li>
</th:block>
@ -96,11 +117,11 @@
</ul>
<!-- Dropdown connected -->
<ul id="dropdown_connected" class="dropdown-content ">
<ul class="dropdown-content " id="dropdown_connected">
<li>
<a class="center blue-grey-text text-darken-4 tooltipped" data-position="left" data-delay="50" data-tooltip="It's you !" id="nav-name" style="font-weight: bold"></a>
<a class="center blue-grey-text text-darken-4 tooltipped" data-delay="50" data-position="left"
data-tooltip="It's you !" id="nav-name" style="font-weight: bold"></a>
</li>
<li class="divider"></li>
<li><a class="center nav-change-guild" href="#">Change Server</a></li>
@ -108,10 +129,12 @@
<a class=" center waves-effect waves-light " href="/settings">Bot Settings</a>
</li>
<li>
<a class="center tooltipped" data-position="left" data-delay="50" data-tooltip="Under Development!">My Account</a>
<a class="center tooltipped" data-delay="50" data-position="left" data-tooltip="Under Development!">My
Account</a>
</li>
<li>
<a class="center tooltipped" data-position="left" data-delay="50" data-tooltip="Under Development!">My Playlists</a>
<a class="center tooltipped" data-delay="50" data-position="left" data-tooltip="Under Development!">My
Playlists</a>
</li>
<li class="divider"></li>
@ -119,29 +142,28 @@
</ul>
<!--________________________________________-->
<!-- Guild modal -->
<!--________________________________________-->
<div id="modal_guild" class="modal">
<div class="modal" id="modal_guild">
<div class="modal-content" style="padding-bottom: 0px">
<div class="row" style="margin-bottom: 0px">
<h3 class="col l12 m12 s12 center">Server Selection</h3>
<div class="col l4 offset-l4 m8 offset-m4 offset-s3 s8 center">
<form id="guild_form" action="#" class="left-align">
<form action="#" class="left-align" id="guild_form">
</form>
</div>
</div>
</div>
<div class="modal-footer">
<a href="#" id="btn_ok_guild" class="modal-action modal-close waves-effect waves-green btn-flat disabled">Ok</a>
<a class="modal-action modal-close waves-effect waves-green btn-flat disabled" href="#"
id="btn_ok_guild">Ok</a>
</div>
</div>
<div id="modal_internet" class="modal">
<div class="modal" id="modal_internet">
<div class="modal-content" style="padding-bottom: 0px">
<div class="row" style="margin-bottom: 0px">
<h3 class="col l12 m 12 s12 center red-text">Can't connect to the server!</h3>
@ -155,12 +177,10 @@
</div>
<p id="radioTemplateGuild" class="" style="visibility: hidden; display: none ">
<p class="" id="radioTemplateGuild" style="visibility: hidden; display: none ">
<label>
<input name="guildRadio" class="with-gap" type="radio" value="@id" id="@id" data-icon="@url"/>
<span><img src="@url" class="circle left" style="max-height: 100%; margin-right: 6px"/> @name</span>
<input class="with-gap" data-icon="@url" id="@id" name="guildRadio" type="radio" value="@id"/>
<span><img class="circle left" src="@url" style="max-height: 100%; margin-right: 6px"/> @name</span>
</label>
</p>

View File

@ -5,32 +5,37 @@
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=UA-144247946-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', 'UA-144247946-1');
</script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0"/>
<meta name="description" content="Claptrap discord bot at your service! Add me to your discord server and my beautiful web interface will be there for you ! Music control, config, news, you can do anything with my web page!"/>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<meta content="width=device-width, initial-scale=1, maximum-scale=1.0" name="viewport"/>
<meta content="Claptrap discord bot at your service! Add me to your discord server and my beautiful web interface will be there for you ! Music control, config, news, you can do anything with my web page!"
name="description"/>
<title>Claptrap Bot</title>
<link rel="icon"
type="image/x-icon"
href="/favicon.png"/>
<link href="/favicon.png"
rel="icon"
type="image/x-icon"/>
<!-- CSS -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"/>
<link href="css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<link href="css/style.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<link rel="manifest" href="/manifest.json"/>
<link href="css/materialize.css" media="screen,projection" rel="stylesheet" type="text/css"/>
<link href="css/style.css" media="screen,projection" rel="stylesheet" type="text/css"/>
<link href="/manifest.json" rel="manifest"/>
<th:block th:if="${isLogged} == true and ${noMutualGuilds} == false">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/octicons/2.0.2/octicons.min.css"/>
<link rel="stylesheet" href="css/github-activity.css"/>
<link href="//cdnjs.cloudflare.com/ajax/libs/octicons/2.0.2/octicons.min.css" rel="stylesheet"/>
<link href="css/github-activity.css" rel="stylesheet"/>
</th:block>
<meta name="theme-color" content="#263238"/>
<meta content="#263238" name="theme-color"/>
<style>
@media only screen and (max-width: 992px) {
.row.valign-wrapper {
@ -42,7 +47,6 @@
</style>
</head>
<body class="blue-grey lighten-5">
@ -62,18 +66,18 @@
<div th:if="${isLogged} == false">
<div class="row valign-wrapper">
<div class="col m6 offset-s2 s8 center">
<img src="/favicon.png" class="responsive-img"/>
<img class="responsive-img" src="/favicon.png"/>
<div class="card blue-grey">
<div class="card-content white-text center z-depth-5">
<span class="card-title">Add me to your server !</span>
<a class="btn green" th:href="${inviteLink}" target="_blank">Invite me !</a>
<a class="btn green" target="_blank" th:href="${inviteLink}">Invite me !</a>
</div>
</div>
</div>
<div class="col m6 s12 center flow-text">
<h2>Hello you !</h2>
<h4>Please log in to have access to your server</h4>
<a class="btn green pulse" style="margin-top: 10px" href="/login">Log in / Register</a>
<a class="btn green pulse" href="/login" style="margin-top: 10px">Log in / Register</a>
</div>
</div>
@ -84,13 +88,14 @@
<div th:if="${noMutualGuilds} == true">
<div class="row valign-wrapper">
<div class="col m6 offset-s3 s6">
<img src="/favicon.png" class="responsive-img"/>
<img class="responsive-img" src="/favicon.png"/>
</div>
<div class="col m6 s12 center flow-text">
<h2>Oh no !</h2>
<h4>We don't have any mutual server !</h4>
<h5>You can change this by inviting me with this button !</h5>
<a th:href="${inviteLink}" class="btn blue pulse" style="margin-top: 10px" href="/login" target="_blank">Invite me !</a>
<a class="btn blue pulse" href="/login" style="margin-top: 10px" target="_blank"
th:href="${inviteLink}">Invite me !</a>
</div>
</div>
@ -98,12 +103,13 @@
<div th:if="${noMutualGuilds} == false">
<div class="row">
<div class="col l6 offset-s2 s8 center">
<img src="/favicon.png" class="responsive-img"/>
<img class="responsive-img" src="/favicon.png"/>
<h2 class="flow-text">Home Page Comming soon!</h2>
<div class="card blue-grey">
<div class="card-content white-text center z-depth-4">
<span class="card-title">Add me to your server !</span>
<a class="btn green waves-effect" th:href="${inviteLink}" target="_blank">Invite me !</a>
<a class="btn green waves-effect" target="_blank" th:href="${inviteLink}">Invite me
!</a>
</div>
</div>
</div>
@ -130,7 +136,8 @@
<script th:src="@{/js/fontawesome.js}"></script>
<script th:src="@{/js/workerRegister.js}"></script>
<th:block th:if="${isLogged} == true and ${noMutualGuilds} == false">
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mustache.js/3.0.1/mustache.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mustache.js/3.0.1/mustache.min.js"
type="text/javascript"></script>
<script th:src="@{/js/github-activity.js}"></script>
<script>
GitHubActivity.feed({
@ -143,6 +150,5 @@
</th:block>
</body>
</html>

View File

@ -1,18 +1,18 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0"/>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<meta content="width=device-width, initial-scale=1, maximum-scale=1.0" name="viewport"/>
<title>Claptrap Bot</title>
<link rel="icon"
type="image/x-icon"
href="/favicon.png"/>
<link href="/favicon.png"
rel="icon"
type="image/x-icon"/>
<!-- CSS -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"/>
<link href="css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<link href="css/style.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<meta name="theme-color" content="#263238"/>
<link href="css/materialize.css" media="screen,projection" rel="stylesheet" type="text/css"/>
<link href="css/style.css" media="screen,projection" rel="stylesheet" type="text/css"/>
<meta content="#263238" name="theme-color"/>
</head>
<body class="blue-grey lighten-5">
@ -25,8 +25,9 @@
<header>
<nav class="brown darken-4 z-depth-3" role="navigation">
<div class="nav-wrapper container">
<a href="/" class="brand-logo hide-on-small-and-down center" style="white-space: nowrap">Claptrap Bot</a>
<a href="/" class="brand-logo hide-on-med-and-up show-on-small center" style="white-space: nowrap">Claptrap</a>
<a class="brand-logo hide-on-small-and-down center" href="/" style="white-space: nowrap">Claptrap Bot</a>
<a class="brand-logo hide-on-med-and-up show-on-small center" href="/"
style="white-space: nowrap">Claptrap</a>
</div>
</nav>
</header>

View File

@ -4,23 +4,27 @@
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=UA-144247946-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', 'UA-144247946-1');
</script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0"/>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<meta content="width=device-width, initial-scale=1, maximum-scale=1.0" name="viewport"/>
<title>Claptrap Bot</title>
<link rel="icon"
type="image/x-icon"
href="/favicon.png"/>
<link href="/favicon.png"
rel="icon"
type="image/x-icon"/>
<!-- CSS -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"/>
<link href="css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<link href="css/style.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<meta name="theme-color" content="#263238"/>
<link href="css/materialize.css" media="screen,projection" rel="stylesheet" type="text/css"/>
<link href="css/style.css" media="screen,projection" rel="stylesheet" type="text/css"/>
<meta content="#263238" name="theme-color"/>
</head>
@ -34,8 +38,9 @@
<header>
<nav class="brown darken-4 z-depth-3" role="navigation">
<div class="nav-wrapper container">
<a href="/" class="brand-logo hide-on-small-and-down center" style="white-space: nowrap">Claptrap Bot</a>
<a href="/" class="brand-logo hide-on-med-and-up show-on-small center" style="white-space: nowrap">Claptrap</a>
<a class="brand-logo hide-on-small-and-down center" href="/" style="white-space: nowrap">Claptrap Bot</a>
<a class="brand-logo hide-on-med-and-up show-on-small center" href="/"
style="white-space: nowrap">Claptrap</a>
</div>
</nav>
</header>
@ -66,11 +71,12 @@
</div>
</div>
<div class="row center" style="margin-bottom: 0px">
<form name="login_form" id="login_form">
<form id="login_form" name="login_form">
<div class="row" style="margin-bottom: 0px">
<div class="input-field col l6 offset-l3 m10 offset-m1 s10 offset-s1">
<i class="material-icons prefix">account_box</i>
<input name="username" id="user_input" type="text" class="validate" autocomplete="username"/>
<input autocomplete="username" class="validate" id="user_input" name="username"
type="text"/>
<label for="user_input">User Name</label>
<span class="helper-text" data-error="User not registered!"></span>
</div>
@ -78,13 +84,16 @@
<div class="row">
<div class="input-field col l6 offset-l3 m10 offset-m1 s10 offset-s1">
<i class="material-icons prefix">security</i>
<input name="password" id="password_input" type="password" class="validate" autocomplete="current-password"/>
<input autocomplete="current-password" class="validate" id="password_input" name="password"
type="password"/>
<label for="password_input">Password</label>
<span class="helper-text" data-error="Wrong password!"></span>
</div>
</div>
<div class="row" style="margin-bottom: 10px">
<button id="btn-submit-connect" class="btn waves-effect waves-light light-green darken-1 scale-transition scale-out" type="submit" name="action" >
<button class="btn waves-effect waves-light light-green darken-1 scale-transition scale-out"
id="btn-submit-connect"
name="action" type="submit">
Submit<i class="material-icons right">send</i>
</button>
</div>
@ -113,7 +122,7 @@
<script th:src="@{/js/materialize.js}"></script>
<script th:src="@{/js/login.js}"></script>
<script th:src="@{/js/js.cookie.js}"></script>
<script src="https://use.fontawesome.com/releases/v5.3.1/js/all.js" crossorigin="anonymous"></script>
<script crossorigin="anonymous" src="https://use.fontawesome.com/releases/v5.3.1/js/all.js"></script>
</body>

View File

@ -4,24 +4,28 @@
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=UA-144247946-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', 'UA-144247946-1');
</script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0"/>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<meta content="width=device-width, initial-scale=1, maximum-scale=1.0" name="viewport"/>
<title>Music Control - Claptrap Bot</title>
<link rel="icon"
type="image/x-icon"
href="favicon.png"/>
<link href="favicon.png"
rel="icon"
type="image/x-icon"/>
<!-- CSS -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"/>
<link href="/css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<link href="/css/style.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<link rel="manifest" href="/manifest.json"/>
<meta name="theme-color" content="#263238"/>
<link href="/css/materialize.css" media="screen,projection" rel="stylesheet" type="text/css"/>
<link href="/css/style.css" media="screen,projection" rel="stylesheet" type="text/css"/>
<link href="/manifest.json" rel="manifest"/>
<meta content="#263238" name="theme-color"/>
<style>
@media only screen and (max-width: 1200px) {
#modalAdd {
@ -34,6 +38,7 @@
width: 80%;
}
}
@media only screen and (min-width: 993px) {
#card-playlist {
max-height: 75vh;
@ -101,8 +106,8 @@
<div class="row">
<div class="col l8 s12 m12">
<div class="row center">
<img class="responsive-img z-depth-3" id="music_img" style="max-width: 30%"
src="/img/disconnected.png"/>
<img class="responsive-img z-depth-3" id="music_img" src="/img/disconnected.png"
style="max-width: 30%"/>
</div>
<h4 class="center" id="music_text"></h4>
<div class="row center" style="margin-bottom: 0px">
@ -111,11 +116,11 @@
</div>
</div>
<div class="row center">
<div class="col l2 offset-l3 m2 offset-m1 s2 offset-s1 left-align" style="padding: 0px"
id="current_time">0:00
<div class="col l2 offset-l3 m2 offset-m1 s2 offset-s1 left-align" id="current_time"
style="padding: 0px">0:00
</div>
<div class="col l2 offset-l2 m2 offset-m6 s2 offset-s6 right-align " style="padding: 0px"
id="total_time">0:00
<div class="col l2 offset-l2 m2 offset-m6 s2 offset-s6 right-align " id="total_time"
style="padding: 0px">0:00
</div>
</div>
<div class="row center">
@ -171,17 +176,17 @@
</div>
<div class="col l3 m2 s2 center" style="padding-right: 0px; padding-left: 0px">
<!-- Modal Trigger -->
<a class="waves-effect waves-light btn modal-trigger green darken-4" id="add_btn"
href="#modalAdd"><i class="material-icons">add_circle_outline</i></a>
<a class="waves-effect waves-light btn modal-trigger green darken-4" href="#modalAdd"
id="add_btn"><i class="material-icons">add_circle_outline</i></a>
</div>
<div class="col l3 m2 s2 center " style="padding-left: 0px">
<div class="row switch blue-grey-text text-darken-3" style="margin-bottom: 0px">
AutoFlow
</div>
<div class="row switch tooltipped ctl-btn" data-position="bottom" data-delay="50"
<div class="row switch tooltipped ctl-btn" data-delay="50" data-position="bottom"
data-tooltip="Experimental!">
<label>
<input type="checkbox" id="autoflow"/>
<input id="autoflow" type="checkbox"/>
<span class="lever"></span>
</label>
</div>
@ -197,7 +202,7 @@
<td>
<div class="row card-panel scroll" id="card-playlist">
<div class="col s12" style="padding: 0">
<ul id="playlist_list" class="collapsible" data-collapsible="accordion"
<ul class="collapsible" data-collapsible="accordion" id="playlist_list"
style="margin: 0px">
</ul>
@ -217,7 +222,7 @@
<!-- Music -->
<div id="modal_current_info" class="modal bottom-sheet">
<div class="modal bottom-sheet" id="modal_current_info">
<div class="modal-content">
<ul class="collection">
<li class="collection-item " id="modal_title"></li>
@ -234,7 +239,7 @@
</div>
<!--Add Modal-->
<div id="modalAdd" class="modal modal-fixed-footer ">
<div class="modal modal-fixed-footer " id="modalAdd">
<div class="modal-content" style="padding-bottom: 0px">
<div class="row valign-wrapper">
<h3 class="col l12 m12 s12 center"> Add Music</h3>
@ -246,7 +251,7 @@
<div class="input-field col offset-l1 l9 m9 s7"
style="padding-left: 0px; padding-right: 0px">
<!--<i class="material-icons prefix">link</i>-->
<input id="input_search" type="text" class="validate"/>
<input class="validate" id="input_search" type="text"/>
<label for="input_search">Search</label>
</div>
<div class="input-field col l1 m2 s3" style="margin-top: 22px">
@ -297,7 +302,7 @@
<div class="modal-footer">
<span style="margin-right: 10px">
<label>
<input name="group1" type="radio" checked="checked" id="bottom"/>
<input checked="checked" id="bottom" name="group1" type="radio"/>
<span>Bottom</span>
</label>
</span>
@ -307,7 +312,7 @@
<span>Top</span>
</label>
</span>
<a href="#" class="modal-action modal-close waves-effect waves-green btn-flat">Close</a>
<a class="modal-action modal-close waves-effect waves-green btn-flat" href="#">Close</a>
</div>
</div>
@ -319,7 +324,7 @@
<ul class="collection">
<li class="collection-item">Author: @author</li>
<li class="collection-item">Duration: @lenght</li>
<li class="collection-item">URL: <a target="_blank" href="@url">@url</a></li>
<li class="collection-item">URL: <a href="@url" target="_blank">@url</a></li>
<li class="collection-item">Submitted by: @user</li>
<li class="collection-item center">
<a class="btn red darken-4 z-depth-3 waves-effect waves-light btn_dell_playlist" data_url="@url">
@ -331,27 +336,27 @@
</li>
<!-- Modal Chanels -->
<div id="modalChanels" class="modal">
<div class="modal" id="modalChanels">
<div class="modal-content" style="padding-bottom: 0px">
<div class="row" style="margin-bottom: 0px">
<h3 class="col l12 m12 s12 center">Vocal Channels</h3>
<div class="col offset-l4 l4 m4 offset-m4 s8 offset-s2 center">
<form id="channelForm" action="#" class="left-align">
<form action="#" class="left-align" id="channelForm">
</form>
</div>
</div>
</div>
<div class="modal-footer">
<a href="/" class="modal-action modal-close waves-effect waves-red btn-flat ">Cancel</a>
<a href="#!" id="btn_ok_channel"
class="modal-action modal-close waves-effect waves-green btn-flat disabled">Connect</a>
<a class="modal-action modal-close waves-effect waves-red btn-flat " href="/">Cancel</a>
<a class="modal-action modal-close waves-effect waves-green btn-flat disabled" href="#!"
id="btn_ok_channel">Connect</a>
</div>
</div>
<!--Loading Modal-->
<div id="modal_loading" class="modal valign-wrapper">
<div class="modal valign-wrapper" id="modal_loading">
<div class="modal-content">
<div class="row center">
<h3 class="col l12 m12 s12 center">Please wait</h3>
@ -411,9 +416,9 @@
</div>
<p id="radioTemplate" class="" style="visibility: hidden; display: none">
<p class="" id="radioTemplate" style="visibility: hidden; display: none">
<label>
<input name="vocalRadio" class="with-gap" type="radio" value="@id" id="@id"/>
<input class="with-gap" id="@id" name="vocalRadio" type="radio" value="@id"/>
<span for="@id">@name</span>
</label>

View File

@ -1,18 +1,18 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0"/>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<meta content="width=device-width, initial-scale=1, maximum-scale=1.0" name="viewport"/>
<title>Claptrap Bot</title>
<link rel="icon"
type="image/x-icon"
href="/favicon.png"/>
<link href="/favicon.png"
rel="icon"
type="image/x-icon"/>
<!-- CSS -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"/>
<link href="css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<link href="css/style.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<meta name="theme-color" content="#263238"/>
<link href="css/materialize.css" media="screen,projection" rel="stylesheet" type="text/css"/>
<link href="css/style.css" media="screen,projection" rel="stylesheet" type="text/css"/>
<meta content="#263238" name="theme-color"/>
</head>
@ -62,7 +62,5 @@
<script th:src="@{/js/fontawesome.js}"></script>
</body>
</html>

View File

@ -5,25 +5,29 @@
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=UA-144247946-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', 'UA-144247946-1');
</script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0"/>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<meta content="width=device-width, initial-scale=1, maximum-scale=1.0" name="viewport"/>
<title>Claptrap Bot</title>
<link rel="icon"
type="image/x-icon"
href="/favicon.png"/>
<link href="/favicon.png"
rel="icon"
type="image/x-icon"/>
<!-- CSS -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"/>
<link href="css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<link href="css/style.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<link rel="manifest" href="/manifest.json"/>
<meta name="theme-color" content="#263238"/>
<link href="css/materialize.css" media="screen,projection" rel="stylesheet" type="text/css"/>
<link href="css/style.css" media="screen,projection" rel="stylesheet" type="text/css"/>
<link href="/manifest.json" rel="manifest"/>
<meta content="#263238" name="theme-color"/>
<style>
tr {
border-color: #fbcf40;
@ -39,11 +43,13 @@
color: #fbcf40;
font-size: 12px;
}
.collapsible {
border-color: #fbcf40;
border-left: none;
border-right: none;
}
.collapsible-header {
border-color: #fbcf40;
}
@ -67,15 +73,16 @@
<th:block th:if="${stack != null}">
<div class="row" style="margin-bottom: 0">
<div class="col l6 offset-l3 m10 offset-m1 s10 offset-s1 card-panel grey darken-4 white-text">
<h4 class="center" style="font-weight: bold"><span th:text="${guild_name}" th:remove="tag"></span><br/>Stats </h4>
<h4 class="center" style="font-weight: bold"><span th:remove="tag" th:text="${guild_name}"></span><br/>Stats
</h4>
</div>
</div>
<div class="row">
<div class="card-panel col l6 offset-l3 m10 offset-m1 s10 offset-s1 grey darken-4 white-text">
<div class="row" style="margin-bottom: 0">
<div class="col s12 center" style="margin-top: 10px">
<img class="circle" th:src="${stack.selfStats.avatarUrl}"
style="border-color: green; border-style: solid;"/>
<img class="circle" style="border-color: green; border-style: solid;"
th:src="${stack.selfStats.avatarUrl}"/>
</div>
<div class="col s12 center">
<h4 style="font-weight: bold; margin: 0;" th:text="${stack.selfStats.userName}"></h4>
@ -92,8 +99,8 @@
<tbody>
<tr>
<td>
<h4 style="font-weight: bold; margin: 0"><span th:text="${stack.rank}"
th:remove="tag"></span> <span
<h4 style="font-weight: bold; margin: 0"><span th:remove="tag"
th:text="${stack.rank}"></span> <span
th:text="${' / ' + stack.ranking.size()}">/ 50</span></h4>
</td>
</tr>
@ -111,8 +118,8 @@
<tbody>
<tr>
<td>
<h4 style="font-weight: bold; margin: 0"><span th:text="${stack.selfStats.total}"
th:remove="tag"></span>
<h4 style="font-weight: bold; margin: 0"><span th:remove="tag"
th:text="${stack.selfStats.total}"></span>
<span>Xp</span>
</h4>
</td>
@ -135,12 +142,12 @@
<tr>
<td>
<h4 style="font-weight: bold; margin: 0">
<span th:text="${T(net.Broken.Tools.TimeConvertor).sToTime(stack.selfStats.voiceTime).get(0)}"
th:remove="tag"></span> <span>H</span>
<span th:text="${T(net.Broken.Tools.TimeConvertor).sToTime(stack.selfStats.voiceTime).get(1)}"
th:remove="tag"></span> <span>M</span>
<span th:text="${T(net.Broken.Tools.TimeConvertor).sToTime(stack.selfStats.voiceTime).get(2)}"
th:remove="tag"></span> <span>S</span>
<span th:remove="tag"
th:text="${T(net.Broken.Tools.TimeConvertor).sToTime(stack.selfStats.voiceTime).get(0)}"></span> <span>H</span>
<span th:remove="tag"
th:text="${T(net.Broken.Tools.TimeConvertor).sToTime(stack.selfStats.voiceTime).get(1)}"></span> <span>M</span>
<span th:remove="tag"
th:text="${T(net.Broken.Tools.TimeConvertor).sToTime(stack.selfStats.voiceTime).get(2)}"></span> <span>S</span>
</h4>
</td>
</tr>
@ -159,8 +166,8 @@
<tr>
<td>
<h4 style="font-weight: bold; margin: 0"><span
th:text="${stack.selfStats.messageCount}"
th:remove="tag"></span> <span>msg</span>
th:remove="tag"
th:text="${stack.selfStats.messageCount}"></span> <span>msg</span>
</h4>
</td>
</tr>
@ -193,14 +200,14 @@
<th:block th:each="stat : ${stack.ranking}">
<tr>
<td th:text="${stat.rank}"></td>
<td><img th:src="${stat.avatarUrl}" class="circle" style="max-height: 50px"/></td>
<td><img class="circle" style="max-height: 50px" th:src="${stat.avatarUrl}"/></td>
<td th:text="${stat.userName}"></td>
<td> <span th:text="${T(net.Broken.Tools.TimeConvertor).sToTime(stat.voiceTime).get(0)}"
th:remove="tag"></span> <span>H</span>
<span th:text="${T(net.Broken.Tools.TimeConvertor).sToTime(stat.voiceTime).get(1)}"
th:remove="tag"></span> <span>M</span>
<span th:text="${T(net.Broken.Tools.TimeConvertor).sToTime(stat.voiceTime).get(2)}"
th:remove="tag"></span> <span>S</span></td>
<td> <span th:remove="tag"
th:text="${T(net.Broken.Tools.TimeConvertor).sToTime(stat.voiceTime).get(0)}"></span> <span>H</span>
<span th:remove="tag"
th:text="${T(net.Broken.Tools.TimeConvertor).sToTime(stat.voiceTime).get(1)}"></span> <span>M</span>
<span th:remove="tag"
th:text="${T(net.Broken.Tools.TimeConvertor).sToTime(stat.voiceTime).get(2)}"></span> <span>S</span></td>
<td th:text="${stat.messageCount}"></td>
<td th:text="${stat.total}"></td>
@ -219,7 +226,13 @@
<ul class="collapsible popout">
<th:block th:each="stat : ${stack.ranking}">
<li>
<div class="collapsible-header grey darken-3 valign-wrapper"> <span th:text="${stat.rank + '. '}" style="font-weight: bold"></span><img th:src="${stat.avatarUrl}" class="circle" style="max-height: 40px; margin: 0 10px 0 10px"/> <span th:text="${stat.userName}"></span><span class="badge new green" data-badge-caption="xp " th:text="${stat.total}">4</span></div>
<div class="collapsible-header grey darken-3 valign-wrapper"><span
style="font-weight: bold" th:text="${stat.rank + '. '}"></span><img
class="circle" style="max-height: 40px; margin: 0 10px 0 10px"
th:src="${stat.avatarUrl}"/> <span
th:text="${stat.userName}"></span><span class="badge new green"
data-badge-caption="xp "
th:text="${stat.total}">4</span></div>
<div class="collapsible-body grey darken-2">
<table class="centered">
<thead>
@ -232,12 +245,13 @@
<tbody>
<tr>
<td> <span th:text="${T(net.Broken.Tools.TimeConvertor).sToTime(stat.voiceTime).get(0)}"
th:remove="tag"></span> <span>H</span>
<span th:text="${T(net.Broken.Tools.TimeConvertor).sToTime(stat.voiceTime).get(1)}"
th:remove="tag"></span> <span>M</span>
<span th:text="${T(net.Broken.Tools.TimeConvertor).sToTime(stat.voiceTime).get(2)}"
th:remove="tag"></span> <span>S</span></td>
<td> <span
th:remove="tag"
th:text="${T(net.Broken.Tools.TimeConvertor).sToTime(stat.voiceTime).get(0)}"></span> <span>H</span>
<span th:remove="tag"
th:text="${T(net.Broken.Tools.TimeConvertor).sToTime(stat.voiceTime).get(1)}"></span> <span>M</span>
<span th:remove="tag"
th:text="${T(net.Broken.Tools.TimeConvertor).sToTime(stat.voiceTime).get(2)}"></span> <span>S</span></td>
<td th:text="${stat.messageCount}"></td>
</tr>

View File

@ -5,23 +5,27 @@
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=UA-144247946-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', 'UA-144247946-1');
</script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0"/>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<meta content="width=device-width, initial-scale=1, maximum-scale=1.0" name="viewport"/>
<title>Sign up - Claptrap Bot</title>
<link rel="icon" type="image/x-icon" href="favicon.png"/>
<link href="favicon.png" rel="icon" type="image/x-icon"/>
<!-- CSS -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"/>
<link href="css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<link href="css/style.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<link rel="manifest" href="/manifest.json"/>
<meta name="theme-color" content="#263238"/>
<link href="css/materialize.css" media="screen,projection" rel="stylesheet" type="text/css"/>
<link href="css/style.css" media="screen,projection" rel="stylesheet" type="text/css"/>
<link href="/manifest.json" rel="manifest"/>
<meta content="#263238" name="theme-color"/>
</head>
<body class="blue-grey lighten-5">
@ -41,8 +45,8 @@
<div class="col s12">
<div class="input-field inline">
<i class="material-icons prefix">assignment_ind</i>
<input id="name" type="text" class="validate invalid"/>
<label for="name" data-error="" data-success="">Discord Name</label>
<input class="validate invalid" id="name" type="text"/>
<label data-error="" data-success="" for="name">Discord Name</label>
</div>
</div>
</div>
@ -50,8 +54,8 @@
<div class="col s12">
<div class="input-field inline">
<i class="material-icons prefix">security</i>
<input id="passwrd" type="password" class="invalid"/>
<label for="passwrd" data-error="" data-success="">Password</label>
<input class="invalid" id="passwrd" type="password"/>
<label data-error="" data-success="" for="passwrd">Password</label>
</div>
</div>
</div>
@ -59,13 +63,13 @@
<div class="col s12">
<div class="input-field inline">
<i class="material-icons prefix">security</i>
<input id="passwrd2" type="password" class="invalid"/>
<label for="passwrd2" data-error="" data-success="">Confirm</label>
<input class="invalid" id="passwrd2" type="password"/>
<label data-error="" data-success="" for="passwrd2">Confirm</label>
</div>
</div>
</div>
<div class="col s12">
<a id="sendBtn" class="waves-effect waves-light btn scale-transition scale-out">Send<i
<a class="waves-effect waves-light btn scale-transition scale-out" id="sendBtn">Send<i
class="material-icons left">send</i></a>
</div>
</div>
@ -73,7 +77,7 @@
<!-- Modal Structure -->
<div id="modalToken" class="modal">
<div class="modal" id="modalToken">
<div class="modal-content">
<div class="row">
<h3 class="col s12 center"> User Validation</h3>
@ -90,7 +94,7 @@
<div class="row" style="margin-bottom: 0px">
<div class="input-field col s6 offset-s3">
<i class="material-icons prefix">fingerprint</i>
<input id="input_preToken" type="text" class="validate"/>
<input class="validate" id="input_preToken" type="text"/>
<label for="input_preToken">Verification Code</label>
</div>
</div>
@ -98,7 +102,7 @@
</div>
</div>
<div class="modal-footer">
<a href="#" id="preTokenSend" class="modal-action waves-effect waves-green btn scale-transition scale-out">Send</a>
<a class="modal-action waves-effect waves-green btn scale-transition scale-out" href="#" id="preTokenSend">Send</a>
</div>
</div>
</main>

View File

@ -5,25 +5,29 @@
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=UA-144247946-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', 'UA-144247946-1');
</script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0"/>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<meta content="width=device-width, initial-scale=1, maximum-scale=1.0" name="viewport"/>
<title>Bot Settings - Claptrap Bot</title>
<link rel="icon"
type="image/x-icon"
href="/favicon.png"/>
<link href="/favicon.png"
rel="icon"
type="image/x-icon"/>
<!-- CSS -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"/>
<link href="css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<link href="css/style.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<link rel="manifest" href="/manifest.json"/>
<meta name="theme-color" content="#263238"/>
<link href="css/materialize.css" media="screen,projection" rel="stylesheet" type="text/css"/>
<link href="css/style.css" media="screen,projection" rel="stylesheet" type="text/css"/>
<link href="/manifest.json" rel="manifest"/>
<meta content="#263238" name="theme-color"/>
</head>
@ -60,49 +64,51 @@
<div th:each="setting : ${settings}">
<div class="row">
<div class="col l10 offset-l1 m10 offset-m1 s10 offset-s1">
<h5 th:text="${setting.name}" style="font-weight: bold"></h5>
<h5 style="font-weight: bold" th:text="${setting.name}"></h5>
<div class="switch" th:if="${setting.type.toString() == 'BOOL'}">
<label>
Off
<input class="collect-switch" type="checkbox" th:id="${setting.id}"
th:checked="${setting.current}"/>
<input class="collect-switch" th:checked="${setting.current}" th:id="${setting.id}"
type="checkbox"/>
<span class="lever"></span>
On
</label>
<div th:text="${setting.description}"></div>
</div>
<div th:id="${setting.id}" class="input-field col l12 m12 s12 collect-select"
<div class="input-field col l12 m12 s12 collect-select" th:id="${setting.id}"
th:if="${setting.type.toString() == 'LIST'}">
<select>
<option disabled="disabled" th:selected="${setting.current} == ' '" value="">Choose your option
<option disabled="disabled" th:selected="${setting.current} == ' '" value="">Choose
your option
</option>
<option th:each="val : ${setting.values}" th:value="${val.id}"
<option th:each="val : ${setting.values}" th:selected="${setting.current} == ${val.id}"
th:text="${#strings.capitalize(val.name)}"
th:selected="${setting.current} == ${val.id}"></option>
th:value="${val.id}"></option>
</select>
<div th:text="${setting.description}"></div>
</div>
<div th:id="${setting.id}" class="input-field col l12 m12 s12 collect-select-multiple"
<div class="input-field col l12 m12 s12 collect-select-multiple" th:id="${setting.id}"
th:if="${setting.type.toString() == 'SELECT_LIST'}">
<select multiple="multiple">
<option disabled="disabled" value="">Choose your option
</option>
<option th:each="val : ${setting.values}" th:value="${val.id}"
<option th:each="val : ${setting.values}" th:selected="${val.selected} == true"
th:text="${#strings.capitalize(val.name)}"
th:selected="${val.selected} == true"></option>
th:value="${val.id}"></option>
</select>
<div th:text="${setting.description}"></div>
</div>
<div class="input-field col l12 m12 s12 collect" th:if="${setting.type.toString() == 'STRING'}">
<input th:id="${setting.id}" placeholder="Use @name variable" th:value="${setting.current}"
id="first_name" type="text" class="validate collect-text"/>
<div class="input-field col l12 m12 s12 collect"
th:if="${setting.type.toString() == 'STRING'}">
<input class="validate collect-text" id="first_name"
placeholder="Use @name variable"
th:id="${setting.id}" th:value="${setting.current}" type="text"/>
<div th:text="${setting.description}"></div>
</div>
@ -117,7 +123,7 @@
</div>
<div class="row">
<div class="col s12 center">
<a id="sendBtn" class="waves-effect waves-light btn green">Save<i
<a class="waves-effect waves-light btn green" id="sendBtn">Save<i
class="material-icons left">save</i></a>
</div>
</div>
@ -125,7 +131,7 @@
</div>
</div>
<div id="modal_loading" class="modal valign-wrapper">
<div class="modal valign-wrapper" id="modal_loading">
<div class="modal-content">
<div class="row center">
<h3 class="col l12 m12 s12 center">Please wait</h3>