Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework stickers #2104

Merged
merged 55 commits into from
May 18, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
1ac5ee0
Start work on sticker rewrite
MinnDevelopment Apr 22, 2022
7bd92cb
Remove broken javadoc
MinnDevelopment Apr 22, 2022
8292e2c
Add sticker packs and standard stickers
MinnDevelopment Apr 22, 2022
dcdbdf5
Nullable image ids
MinnDevelopment Apr 22, 2022
ad1061b
Add object overrides
MinnDevelopment Apr 23, 2022
a5cda08
Add sticker send support
MinnDevelopment Apr 23, 2022
aca1324
Add MessageBuilder#setStickers and check for edit
MinnDevelopment Apr 23, 2022
fe2e5cc
Add Message#replyStickers
MinnDevelopment Apr 23, 2022
90840a7
Add checks for cross-guild stickers and available
MinnDevelopment Apr 23, 2022
0939906
Add GuildSticker#delete
MinnDevelopment Apr 23, 2022
6492d47
Add GuildSticker#retrieveOwner
MinnDevelopment Apr 23, 2022
3502c47
Add new event classes and update intent name
MinnDevelopment Apr 24, 2022
c5e8283
Improve GuildSticker#retrieveOwner
MinnDevelopment Apr 24, 2022
4fc0c78
Add event handling
MinnDevelopment Apr 24, 2022
7e8619c
Add GuildStickerManager
MinnDevelopment Apr 25, 2022
2bb10a0
Fix typo
MinnDevelopment Apr 25, 2022
6fa7a41
Merge remote-tracking branch 'origin/master' into feature/stickers-re…
MinnDevelopment May 1, 2022
62cca01
Add support for image proxy and cover sticker
MinnDevelopment May 1, 2022
958fb37
Add some basic docs
MinnDevelopment May 1, 2022
d299df7
More docs
MinnDevelopment May 1, 2022
218ab40
Add docs for sending
MinnDevelopment May 1, 2022
e3296a6
Docs for guild sticker methods
MinnDevelopment May 1, 2022
a612a3a
Add docs for Guild#deleteSticker
MinnDevelopment May 1, 2022
b50df63
Fix javadoc errors
MinnDevelopment May 1, 2022
21c1765
Add docs for sticker manager
MinnDevelopment May 1, 2022
75e7d89
Add docs for events
MinnDevelopment May 1, 2022
a1f23cb
Handle remaining todo
MinnDevelopment May 1, 2022
73df1e5
Remove todo
MinnDevelopment May 1, 2022
0ce3636
Make RichStickerImpl implement StickerUnion
MinnDevelopment May 13, 2022
a080ab1
Better use of StickerSnowflake in retrieve
MinnDevelopment May 13, 2022
85f2574
Improve entity builder logs
MinnDevelopment May 13, 2022
085cdd6
Improve some implementation details
MinnDevelopment May 13, 2022
115b443
Make max stickers a constant
MinnDevelopment May 13, 2022
0539cf3
Move sticker routes
MinnDevelopment May 13, 2022
bf56f62
Allow editing stickers without cached guild
MinnDevelopment May 13, 2022
7e04d7c
Improve docs and checks for tags
MinnDevelopment May 13, 2022
d679626
Improve some docs and exception messages
MinnDevelopment May 13, 2022
0b4aa4c
Introduce CacheRestAction
MinnDevelopment May 13, 2022
0f95fe1
Fix setter consistency
MinnDevelopment May 13, 2022
bba0402
Merge remote-tracking branch 'origin/master' into feature/stickers-re…
MinnDevelopment May 13, 2022
b5a4a88
Merge remote-tracking branch 'origin/master' into feature/stickers-re…
MinnDevelopment May 13, 2022
1ae95fb
Add Guild#createSticker
MinnDevelopment May 13, 2022
e48de29
Update src/main/java/net/dv8tion/jda/api/managers/GuildStickerManager…
MinnDevelopment May 14, 2022
d14bde0
Create sticker with collection of tags
MinnDevelopment May 14, 2022
239c937
Rename routes for consistency
MinnDevelopment May 14, 2022
da36d27
Add default implementations in interface
MinnDevelopment May 14, 2022
da277bd
Change throws docs
MinnDevelopment May 14, 2022
161d34d
Improve createSticker errors and structure
MinnDevelopment May 14, 2022
e040fc4
Fix event headers
MinnDevelopment May 14, 2022
d22fe3a
Add back check
MinnDevelopment May 15, 2022
1157164
Merge remote-tracking branch 'origin/master' into feature/stickers-re…
MinnDevelopment May 16, 2022
9726b69
Allow FileUpload to be used more than once
MinnDevelopment May 18, 2022
85040b9
Add FileUpload#getRequestBody
MinnDevelopment May 18, 2022
2b08912
Add missing docs
MinnDevelopment May 18, 2022
bfad42f
Add synchronization for withType
MinnDevelopment May 18, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public GuildStickerImpl copy()
@Override
public String toString()
{
return "RichSticker:" + getType() + ':' + name + '(' + getId() + ",guild=" + getGuildId() + ')';
return "GuildSticker:" + name + '(' + getId() + ", guild=" + getGuildId() + ')';
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@
import net.dv8tion.jda.api.entities.sticker.RichSticker;
import net.dv8tion.jda.api.entities.sticker.StandardSticker;
import net.dv8tion.jda.api.entities.sticker.StickerUnion;
import net.dv8tion.jda.internal.utils.Helpers;

import javax.annotation.Nonnull;
import java.util.Collections;
import java.util.Objects;
import java.util.Set;

public abstract class RichStickerImpl extends StickerItemImpl implements RichSticker, StickerUnion
Expand Down Expand Up @@ -90,28 +88,6 @@ public String setDescription(String description)
@Override
public String toString()
{
return "RichSticker:" + getType() + ':' + name + '(' + getId() + ')';
}

@Override
public int hashCode()
{
return Objects.hash(id, format, name, getType(), tags, description);
}

@Override
public boolean equals(Object obj)
{
if (obj == this)
return true;
if (!(obj instanceof RichStickerImpl))
return false;
RichStickerImpl other = (RichStickerImpl) obj;
return id == other.id
&& format == other.format
&& getType() == other.getType()
&& Objects.equals(name, other.name)
&& Objects.equals(description, other.description)
&& Helpers.deepEqualsUnordered(tags, other.tags);
return "RichSticker[" + getType() + "]:" + name + '(' + getId() + ')';
DV8FromTheWorld marked this conversation as resolved.
Show resolved Hide resolved
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public int getSortValue()
@Override
public String toString()
{
return "RichSticker:" + getType() + ":" + name + '(' + getId() + ",pack=" + getPackId() + ')';
return "StandardSticker:" + name + '(' + getId() + ", pack=" + getPackId() + ')';
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

import net.dv8tion.jda.api.entities.sticker.StandardSticker;
import net.dv8tion.jda.api.entities.sticker.StickerPack;
import org.jetbrains.annotations.NotNull;

import javax.annotation.Nonnull;
import java.util.Collections;
import java.util.List;

Expand Down Expand Up @@ -49,21 +49,21 @@ public long getIdLong()
return id;
}

@NotNull
@Nonnull
@Override
public List<StandardSticker> getStickers()
{
return stickers;
}

@NotNull
@Nonnull
@Override
public String getName()
{
return name;
}

@NotNull
@Nonnull
@Override
public String getDescription()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,10 @@ public boolean equals(Object obj)
return false;
return ((StickerSnowflakeImpl) obj).id == id;
}

@Override
public String toString()
{
return "StickerSnowflake(" + getId() + ')';
}
}