-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
686 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,3 +106,7 @@ bin/ | |
logs\.txt | ||
|
||
\.idea/kotlinc\.xml | ||
|
||
\.idea/artifacts/ | ||
|
||
\.idea/copyright/profiles_settings\.xml |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/main/groovy/ml/duncte123/skybot/RegisterGroovyCommands.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Skybot, a multipurpose discord bot | ||
* Copyright (C) 2017 Duncan "duncte123" Sterken | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published | ||
* by the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package ml.duncte123.skybot | ||
|
||
import ml.duncte123.skybot.commands.fun.TextToBricksCommand | ||
import ml.duncte123.skybot.commands.uncategorized.ShortenCommand | ||
import ml.duncte123.skybot.utils.AirUtils | ||
import org.slf4j.event.Level | ||
|
||
class RegisterGroovyCommands { | ||
static CommandManager manager = AirUtils.commandManager | ||
RegisterGroovyCommands() { | ||
AirUtils.log("GroovyCommandManager", Level.INFO, "Registering groovy commands") | ||
manager.addCommand(new ShortenCommand()) | ||
manager.addCommand(new TextToBricksCommand()) | ||
} | ||
|
||
} |
52 changes: 52 additions & 0 deletions
52
src/main/groovy/ml/duncte123/skybot/commands/fun/TextToBricksCommand.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Skybot, a multipurpose discord bot | ||
* Copyright (C) 2017 Duncan "duncte123" Sterken | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published | ||
* by the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
|
||
package ml.duncte123.skybot.commands.fun | ||
|
||
import ml.duncte123.skybot.objects.command.Command | ||
import ml.duncte123.skybot.utils.EmbedUtils | ||
import ml.duncte123.skybot.utils.Settings | ||
import net.dv8tion.jda.core.events.message.guild.GuildMessageReceivedEvent | ||
import org.apache.commons.lang3.StringUtils | ||
|
||
class TextToBricksCommand extends Command { | ||
@Override | ||
void executeCommand(String invoke, String[] args, GuildMessageReceivedEvent event) { | ||
|
||
if (args.length < 1) { | ||
sendMsg(event, "Correct usage: `${Settings.prefix}$invoke <words>`") | ||
return | ||
} | ||
|
||
def output = StringUtils.join(args, " ") | ||
.replaceAll("([a-zA-Z])", ":regional_indicator_\$1:") | ||
.replaceAll("([0-9])", "\$1\u20E3") | ||
sendEmbed(event, EmbedUtils.embedMessage(output)) | ||
} | ||
|
||
@Override | ||
String help() { | ||
return "Convert your text to bicks" | ||
} | ||
|
||
@Override | ||
String getName() { | ||
return "ttb" | ||
} | ||
} |
Oops, something went wrong.