├── README.md ├── src └── jselfbot │ ├── utils │ ├── FormatUtil.java │ └── WrapUtil.java │ ├── Constants.java │ ├── commands │ ├── PingCmd.java │ ├── SetCmd.java │ ├── DeleteCmd.java │ ├── MeCmd.java │ ├── TimeCmd.java │ ├── EvalCmd.java │ ├── EmoteCmd.java │ ├── DiscrimCmd.java │ ├── GameCmd.java │ ├── ListCmd.java │ ├── ClearCmd.java │ ├── PollCmd.java │ ├── GoogleCmd.java │ ├── EmbedCmd.java │ ├── BashCmd.java │ ├── SpoilerCmd.java │ ├── AvatarCmd.java │ ├── QuoteCmd.java │ └── TodoCmd.java │ ├── JSelfBot.java │ ├── entities │ ├── GoogleSearcher.java │ ├── Emojis.java │ ├── Config.java │ ├── JagTagMethods.java │ ├── Todolist.java │ └── AnimatedGifEncoder.java │ ├── Command.java │ └── Bot.java └── LICENSE /README.md: -------------------------------------------------------------------------------- 1 | # ⚠ All selfbots (and any other 3rd-party clients or client modifications) break Discord's [Terms of Service](https://discordapp.com/terms). Using a selfbot or any client mods puts your account at risk for deletion. Please do not use a selfbot nor any client modifications. 2 | 3 | 🔗 Terms of Service: https://discordapp.com/terms 4 | 5 | 🔗 API Terms of Service: https://discordapp.com/developers/docs/legal 6 | 7 | 🔗 Community Guidelines: https://discordapp.com/guidelines 8 | 9 | This project is no longer supported for the reasons detailed above. 10 | -------------------------------------------------------------------------------- /src/jselfbot/utils/FormatUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package jselfbot.utils; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * 12 | * @author John Grosh (john.a.grosh@gmail.com) 13 | */ 14 | public class FormatUtil 15 | { 16 | 17 | public static String join(List strings, String joiner) 18 | { 19 | if(strings.isEmpty()) 20 | return ""; 21 | StringBuilder sb = new StringBuilder(strings.get(0)); 22 | for(int i=1; i m.editMessage("Ping: "+m.getCreationTime().until(m.getEditedTime(), ChronoUnit.MILLIS)+"ms") 39 | .queue()); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/jselfbot/commands/SetCmd.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 John Grosh (jagrosh). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jselfbot.commands; 17 | 18 | import jselfbot.Command; 19 | import jselfbot.entities.Emojis; 20 | import net.dv8tion.jda.core.events.message.MessageReceivedEvent; 21 | 22 | /** 23 | * 24 | * @author John Grosh (jagrosh) 25 | */ 26 | public class SetCmd extends Command { 27 | private final Emojis emojis; 28 | public SetCmd(Emojis emojis) 29 | { 30 | this.emojis = emojis; 31 | this.name = "set"; 32 | this.description = "sets a :custom: emoji"; 33 | this.arguments = " "; 34 | } 35 | 36 | @Override 37 | protected void execute(String args, MessageReceivedEvent event) { 38 | String[] parts = args.split("\\s+",2); 39 | if(parts.length<2) 40 | { 41 | tempReply("Must include an emoji name and its content", event); 42 | return; 43 | } 44 | emojis.setEmoji(parts[0], parts[1]); 45 | tempReply("Added emoji `:\u200E"+parts[0]+":` that will convert to `"+parts[1]+"`", event); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/jselfbot/commands/DeleteCmd.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 John Grosh (jagrosh). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jselfbot.commands; 17 | 18 | import jselfbot.Command; 19 | import jselfbot.entities.Emojis; 20 | import net.dv8tion.jda.core.events.message.MessageReceivedEvent; 21 | 22 | /** 23 | * 24 | * @author John Grosh (jagrosh) 25 | */ 26 | public class DeleteCmd extends Command { 27 | private final Emojis emojis; 28 | public DeleteCmd(Emojis emojis) 29 | { 30 | this.emojis = emojis; 31 | this.name = "delete"; 32 | this.description = "deletes a :custom: emoji"; 33 | this.arguments = ""; 34 | } 35 | 36 | @Override 37 | protected void execute(String args, MessageReceivedEvent event) { 38 | if(args.isEmpty()) 39 | { 40 | tempReply("Please include an emoji name.", event); 41 | return; 42 | } 43 | String[] parts = args.split("\\s+",2); 44 | boolean deleted = emojis.deleteEmoji(parts[0]); 45 | if(deleted) 46 | tempReply("Deleted emoji `:\u200E"+parts[0]+":`", event); 47 | else 48 | tempReply("Emoji `"+parts[0]+"` was not found.", event); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/jselfbot/commands/MeCmd.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 John Grosh (jagrosh). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jselfbot.commands; 17 | 18 | import jselfbot.Command; 19 | import net.dv8tion.jda.core.EmbedBuilder; 20 | import net.dv8tion.jda.core.entities.Member; 21 | import net.dv8tion.jda.core.events.message.MessageReceivedEvent; 22 | 23 | /** 24 | * 25 | * @author John Grosh (jagrosh) 26 | */ 27 | public class MeCmd extends Command { 28 | 29 | public MeCmd() 30 | { 31 | this.name = "me"; 32 | this.description = "says things"; 33 | this.arguments = ""; 34 | } 35 | 36 | @Override 37 | protected void execute(String args, MessageReceivedEvent event) { 38 | EmbedBuilder builder = new EmbedBuilder(); 39 | String username; 40 | if(event.getGuild()!=null) 41 | { 42 | Member member = event.getGuild().getSelfMember(); 43 | builder.setColor(member.getColor()); 44 | username = member.getEffectiveName(); 45 | } 46 | else 47 | username = event.getAuthor().getName(); 48 | builder.setDescription("***"+username+"*** *"+args+"*"); 49 | reply(builder.build(), event); 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/jselfbot/commands/TimeCmd.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 John Grosh (jagrosh). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jselfbot.commands; 17 | 18 | import java.time.ZoneId; 19 | import java.time.ZonedDateTime; 20 | import java.time.format.DateTimeFormatter; 21 | import jselfbot.Command; 22 | import net.dv8tion.jda.core.events.message.MessageReceivedEvent; 23 | 24 | /** 25 | * 26 | * @author John Grosh (jagrosh) 27 | */ 28 | public class TimeCmd extends Command { 29 | private final ZoneId zone; 30 | public TimeCmd(ZoneId zone) 31 | { 32 | this.zone = zone; 33 | this.name = "time"; 34 | this.description = "checks the time"; 35 | this.type = Type.EDIT_ORIGINAL; 36 | } 37 | 38 | @Override 39 | protected void execute(String args, MessageReceivedEvent event) { 40 | ZonedDateTime t = event.getMessage().getCreationTime().atZoneSameInstant(zone); 41 | String time = t.format(DateTimeFormatter.ofPattern("h:mma")); 42 | String time24 = t.format(DateTimeFormatter.ofPattern("HH:mm")); 43 | String name = event.getGuild()==null ? event.getAuthor().getName() : event.getMember().getEffectiveName(); 44 | reply("\u231A Current time for **"+name+"** is `"+time+"` (`"+time24+"`)", event); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/jselfbot/commands/EvalCmd.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 John Grosh (jagrosh). 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package jselfbot.commands; 17 | 18 | import javax.script.ScriptEngine; 19 | import javax.script.ScriptEngineManager; 20 | import jselfbot.Command; 21 | import net.dv8tion.jda.core.events.message.MessageReceivedEvent; 22 | 23 | /** 24 | * 25 | * @author John Grosh (jagrosh) 26 | */ 27 | public class EvalCmd extends Command { 28 | 29 | public EvalCmd() 30 | { 31 | this.name = "eval"; 32 | this.description = "evaluates using Nashorn"; 33 | this.arguments = "