-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from mineral-dart/develop
feat: Get features from BETA
- Loading branch information
Showing
104 changed files
with
1,933 additions
and
438 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
assets/ |
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 |
---|---|---|
@@ -1,39 +1,19 @@ | ||
<!-- | ||
This README describes the package. If you publish this package to pub.dev, | ||
this README's contents appear on the landing page for your package. | ||
# Mineral | ||
![banner](https://raw.githubusercontent.com/mineral-dart/core/develop/assets/images/banner.png) | ||
|
||
For information about how to write a good package README, see the guide for | ||
[writing package pages](https://dart.dev/guides/libraries/writing-package-pages). | ||
Mineral is a robust, powerful and scalable framework designed to let you develop discord bots with the Dart language. | ||
|
||
For general information about developing packages, see the Dart guide for | ||
[creating packages](https://dart.dev/guides/libraries/create-library-packages) | ||
and the Flutter guide for | ||
[developing packages and plugins](https://flutter.dev/developing-packages). | ||
--> | ||
The Mineral framework currently allows you to use the latest Discord features: | ||
- Slashcommands/Subcommands/Subcommand group | ||
- Modals | ||
- Scheduled events | ||
- Auto-moderation | ||
- Select menus | ||
- Buttons | ||
- Ephemeral messages | ||
|
||
TODO: Put a short description of the package here that helps potential users | ||
know whether this package might be useful for them. | ||
And much more... | ||
|
||
## Features | ||
Join our ranks and add your contribution to the best discord framework for Dart 💪 | ||
|
||
TODO: List what your package can do. Maybe include images, gifs, or videos. | ||
|
||
## Getting started | ||
|
||
TODO: List prerequisites and provide or point to information on how to | ||
start using the package. | ||
|
||
## Usage | ||
|
||
TODO: Include short and useful examples for package users. Add longer examples | ||
to `/example` folder. | ||
|
||
```dart | ||
const like = 'sample'; | ||
``` | ||
|
||
## Additional information | ||
|
||
TODO: Tell users more about the package: where to find more information, how to | ||
contribute to the package, how to file issues, what response they can expect | ||
from the package authors, and more. | ||
https://github.com/mineral-dart |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,2 @@ | ||
dartdoc: | ||
favicon: assets/images/icon.png |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/// Core exceptions | ||
library exception; | ||
|
||
export 'src/exceptions/token_exception.dart'; | ||
|
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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
/// The internal library is the collection of all classes needed by the framework to work. | ||
/// | ||
/// {@category Internal} | ||
/// @nodoc | ||
library internal; | ||
|
||
export 'src/internal/websockets/websockets.dart'; | ||
export 'src/internal/websockets/websockets.dart'; |
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,38 @@ | ||
import 'package:mineral/api.dart'; | ||
import 'package:mineral/core.dart'; | ||
import 'package:mineral/src/api/channels/partial_channel.dart'; | ||
import 'package:mineral/src/api/managers/message_manager.dart'; | ||
|
||
class DmChannel extends PartialChannel { | ||
Snowflake? lastMessageId; | ||
MessageManager messages; | ||
Map<Snowflake, User> recipients; | ||
|
||
DmChannel({ | ||
required id, | ||
required this.lastMessageId, | ||
required this.messages, | ||
required this.recipients, | ||
}): super(id: id); | ||
|
||
factory DmChannel.from({ required dynamic payload }) { | ||
MineralClient client = ioc.singleton(ioc.services.client); | ||
|
||
Map<Snowflake, User> users = {}; | ||
if (payload['recipients'] != null) { | ||
for (dynamic element in payload['recipients']) { | ||
User? user = client.users.cache.get(element['id']); | ||
user ??= User.from(element); | ||
|
||
users.putIfAbsent(user.id, () => user!); | ||
} | ||
} | ||
|
||
return DmChannel( | ||
id: payload['id'], | ||
lastMessageId: payload['last_message_id'], | ||
messages: MessageManager(payload['id'], null), | ||
recipients: users | ||
); | ||
} | ||
} |
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,7 @@ | ||
import 'package:mineral/api.dart'; | ||
|
||
class PartialChannel { | ||
Snowflake id; | ||
|
||
PartialChannel({ required this.id }); | ||
} |
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.