This repository has been archived by the owner on Jun 15, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added embed command added emote command fixed clear command numbers added version number to help
- Loading branch information
Showing
7 changed files
with
104 additions
and
9 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright 2016 John Grosh (jagrosh). | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package jselfbot.commands; | ||
|
||
import jselfbot.Command; | ||
import net.dv8tion.jda.core.EmbedBuilder; | ||
import net.dv8tion.jda.core.events.message.MessageReceivedEvent; | ||
|
||
/** | ||
* | ||
* @author John Grosh (jagrosh) | ||
*/ | ||
public class EmbedCmd extends Command { | ||
|
||
public EmbedCmd() | ||
{ | ||
this.name = "embed"; | ||
this.description = "puts text in an embed"; | ||
this.arguments = "<stuff>"; | ||
} | ||
|
||
@Override | ||
protected void execute(String args, MessageReceivedEvent event) { | ||
EmbedBuilder builder = new EmbedBuilder(); | ||
if(event.getGuild()!=null) | ||
builder.setColor(event.getGuild().getSelfMember().getColor()); | ||
builder.setDescription(args); | ||
reply(builder.build(), event); | ||
} | ||
|
||
} |
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,53 @@ | ||
/* | ||
* Copyright 2016 John Grosh (jagrosh). | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package jselfbot.commands; | ||
|
||
import jselfbot.Command; | ||
import net.dv8tion.jda.core.EmbedBuilder; | ||
import net.dv8tion.jda.core.entities.Emote; | ||
import net.dv8tion.jda.core.events.message.MessageReceivedEvent; | ||
|
||
/** | ||
* | ||
* @author John Grosh (jagrosh) | ||
*/ | ||
public class EmoteCmd extends Command { | ||
|
||
public EmoteCmd() | ||
{ | ||
this.name = "emote"; | ||
this.description = "checks info about an emote"; | ||
this.arguments = "<:emote:>"; | ||
} | ||
|
||
@Override | ||
protected void execute(String args, MessageReceivedEvent event) { | ||
String id = args.replaceAll("<:.+:(\\d+)>", "$1"); | ||
Emote emote = event.getJDA().getEmoteById(id); | ||
if(emote==null) | ||
tempReply("Invalid emote or emote ID", event); | ||
else | ||
{ | ||
EmbedBuilder builder = new EmbedBuilder(); | ||
if(event.getGuild()!=null) | ||
builder.setColor(event.getGuild().getSelfMember().getColor()); | ||
builder.setImage(emote.getImageUrl()); | ||
builder.setDescription(emote.getAsMention()+" **:"+emote.getName()+":**\nID: **"+emote.getId()+"**\nGuild: **"+emote.getGuild().getName()+"**"); | ||
reply(builder.build(), event); | ||
} | ||
} | ||
|
||
} |
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