-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed LanguageEngine.class acc. to #48
Cleaned up the language engine quite a bit and added support for simple String answers instead of embedded messages.
- Loading branch information
1 parent
1e27cba
commit b2f5093
Showing
48 changed files
with
399 additions
and
353 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package assets.base; | ||
|
||
import com.mongodb.lang.Nullable; | ||
|
||
import net.dv8tion.jda.api.EmbedBuilder; | ||
import net.dv8tion.jda.api.entities.Member; | ||
import net.dv8tion.jda.api.entities.MessageEmbed; | ||
|
||
public class MutableMessageEmbed extends MessageEmbed { | ||
|
||
EmbedBuilder eb = new EmbedBuilder(); | ||
|
||
public MutableMessageEmbed(MessageEmbed embed) { | ||
super(embed.getUrl(), embed.getTitle(), embed.getDescription(), embed.getType(), embed.getTimestamp(), | ||
embed.getColorRaw(), embed.getThumbnail(), embed.getSiteProvider(), embed.getAuthor(), | ||
embed.getVideoInfo(), embed.getFooter(), embed.getImage(), embed.getFields()); | ||
eb.copyFrom(embed); | ||
} | ||
|
||
public MutableMessageEmbed replaceTitle(String target, String replacement) { | ||
eb.setTitle(this.getTitle().replace(target, replacement)); | ||
return new MutableMessageEmbed(eb.build()); | ||
} | ||
|
||
public MutableMessageEmbed replaceDescription(String target, String replacement) { | ||
eb.setDescription(this.getDescription().replace(target, replacement)); | ||
return new MutableMessageEmbed(eb.build()); | ||
} | ||
|
||
public MutableMessageEmbed setTitle(String title) { | ||
eb.setTitle(title); | ||
return new MutableMessageEmbed(eb.build()); | ||
} | ||
|
||
public MutableMessageEmbed setDescription(String description) { | ||
eb.setDescription(description); | ||
return new MutableMessageEmbed(eb.build()); | ||
} | ||
|
||
public MutableMessageEmbed setFooter(String replacement, @Nullable String iconURL) { | ||
eb.setFooter(replacement, iconURL); | ||
return new MutableMessageEmbed(eb.build()); | ||
} | ||
|
||
public MutableMessageEmbed setAuthor(Member member) { | ||
eb.setAuthor(member.getEffectiveName(), member.getAvatarUrl()); | ||
return new MutableMessageEmbed(eb.build()); | ||
} | ||
|
||
public MutableMessageEmbed setThumbnail(String url) { | ||
eb.setThumbnail(url); | ||
return new MutableMessageEmbed(eb.build()); | ||
} | ||
} |
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
Oops, something went wrong.