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

Feat/implement server message methods #183

Merged
merged 20 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
2e02a85
ServerMessage.delete(), ServerMessage.edit(), ServerMessage.reply()
DakioCode Jul 11, 2024
0a03ce6
feat(server-messages) ServerMessage.pin()
DakioCode Jul 15, 2024
ad24688
feat(server-messages): ServerMessage.unpin()
DakioCode Jul 15, 2024
30f5fc0
feat(server-messages): ServerMessage.crosspost()
DakioCode Jul 15, 2024
7c2c447
feat(server-messages) added cache put in ServerMessagePart.update() a…
DakioCode Jul 16, 2024
2b1ae52
ServerMessage.delete(), ServerMessage.edit(), ServerMessage.reply()
DakioCode Jul 11, 2024
fe3e1dd
feat(server-messages) ServerMessage.pin()
DakioCode Jul 15, 2024
2869333
feat(server-messages): ServerMessage.unpin()
DakioCode Jul 15, 2024
0e2d57f
feat(server-messages): ServerMessage.crosspost()
DakioCode Jul 15, 2024
54e9274
feat(messages): remove duplicate methods
LeadcodeDev Aug 4, 2024
6ebffb1
feat(messages): enhance serialization
LeadcodeDev Aug 4, 2024
79e02ed
feat(marshaller): enhance message serialization
LeadcodeDev Aug 4, 2024
1216e73
feat(marshaller): compute channel
LeadcodeDev Aug 5, 2024
c9021b7
feat(ServerMessage) removed type checking in reply method
DakioCode Aug 8, 2024
30c1968
feat(ServerMessage) added embeds in reply method (ServerMessagePart) …
DakioCode Aug 8, 2024
3c56c42
feat(ServerMessage) allowed embeds and components editing
DakioCode Aug 8, 2024
1153010
feat(ServerMessage) (ServerMessagePart) removed possibilities of of i…
DakioCode Aug 8, 2024
782ab9a
feat(ServerMessage) (ServerMessagePart) removed two times message ser…
DakioCode Aug 8, 2024
8f079e0
feat(ServerMessage) add components to reply method
DakioCode Aug 9, 2024
362b507
feat: rebase and fix bad color serialization
LeadcodeDev Sep 9, 2024
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
1 change: 0 additions & 1 deletion lib/api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export 'package:mineral/src/api/common/embed/message_embed.dart';
export 'package:mineral/src/api/common/embed/message_embed_assets.dart';
export 'package:mineral/src/api/common/embed/message_embed_author.dart';
export 'package:mineral/src/api/common/embed/message_embed_builder.dart';
export 'package:mineral/src/api/common/embed/message_embed_color.dart';
export 'package:mineral/src/api/common/embed/message_embed_field.dart';
export 'package:mineral/src/api/common/embed/message_embed_footer.dart';
export 'package:mineral/src/api/common/embed/message_embed_image.dart';
Expand Down
11 changes: 2 additions & 9 deletions lib/src/api/common/embed/message_embed_assets.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import 'package:mineral/src/api/common/embed/message_embed_author.dart';
import 'package:mineral/src/api/common/embed/message_embed_color.dart';
import 'package:mineral/src/api/common/embed/message_embed_footer.dart';
import 'package:mineral/src/api/common/embed/message_embed_image.dart';
import 'package:mineral/api.dart';
import 'package:mineral/src/infrastructure/commons/helper.dart';

final class MessageEmbedAssets {
Expand All @@ -10,25 +7,22 @@ final class MessageEmbedAssets {
final MessageEmbedImage? video;
final MessageEmbedFooter? footer;
final MessageEmbedAuthor? author;
final MessageEmbedColor color;

const MessageEmbedAssets({
required this.image,
required this.thumbnail,
required this.video,
required this.footer,
required this.author,
required this.color,
});

Object toJson() {
Map<String, dynamic> toJson() {
return {
'image': image?.toJson(),
'thumbnail': thumbnail?.toJson(),
'video': video?.toJson(),
'footer': footer?.toJson(),
'author': author?.toJson(),
'color': color,
};
}

Expand All @@ -49,7 +43,6 @@ final class MessageEmbedAssets {
author: Helper.createOrNull(
field: json['author'],
fn: () => MessageEmbedAuthor.fromJson(json['author'])),
color: json['color'],
);
}
}
10 changes: 5 additions & 5 deletions lib/src/api/common/embed/message_embed_builder.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:mineral/api.dart';
import 'package:mineral/src/api/common/embed/message_embed.dart';
import 'package:mineral/src/api/common/embed/message_embed_assets.dart';
import 'package:mineral/src/api/common/embed/message_embed_author.dart';
import 'package:mineral/src/api/common/embed/message_embed_color.dart';
import 'package:mineral/src/api/common/embed/message_embed_field.dart';
import 'package:mineral/src/api/common/embed/message_embed_footer.dart';
import 'package:mineral/src/api/common/embed/message_embed_image.dart';
Expand All @@ -11,7 +11,7 @@ final class MessageEmbedBuilder {
String? description;
String? url;
DateTime? timestamp;
MessageEmbedColor? color;
Color? color;
MessageEmbedFooter? footer;
MessageEmbedAuthor? author;
MessageEmbedImage? image;
Expand All @@ -34,7 +34,7 @@ final class MessageEmbedBuilder {
return this;
}

MessageEmbedBuilder setColor(MessageEmbedColor color) {
MessageEmbedBuilder setColor(Color color) {
this.color = color;
return this;
}
Expand Down Expand Up @@ -94,13 +94,13 @@ final class MessageEmbedBuilder {
description: description,
url: url,
timestamp: timestamp,
color: color ?? Color('#000000'),
assets: MessageEmbedAssets(
image: image,
thumbnail: image,
video: image,
footer: footer,
author: author,
color: color ?? MessageEmbedColor.of('#000000')),
author: author),
fields: fields);
}
}
221 changes: 0 additions & 221 deletions lib/src/api/common/embed/message_embed_color.dart

This file was deleted.

Loading