library.dr-conversion 0.1.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +158 -23
- package/dist/providers/root/converters.d.ts +11 -11
- package/dist/providers/root/converters.d.ts.map +1 -1
- package/dist/providers/root/converters.js +57 -164
- package/dist/providers/root/converters.js.map +1 -1
- package/dist/providers/root/provider.d.ts +20 -9
- package/dist/providers/root/provider.d.ts.map +1 -1
- package/dist/providers/root/provider.js +270 -32
- package/dist/providers/root/provider.js.map +1 -1
- package/dist/providers/root/types.d.ts.map +1 -1
- package/dist/providers/root/types.js.map +1 -1
- package/package.json +7 -2
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
[](https://www.npmjs.com/package/library.dr-conversion)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
7
7
|
|
|
8
|
-
**Library.DR-Conversion** (v0.
|
|
8
|
+
**Library.DR-Conversion** (v0.2.4) is a TypeScript library that provides a unified, platform-agnostic interface for building chat bots that work across multiple platforms like Discord, Root, and potentially others. Write your bot logic once, and deploy it anywhere!
|
|
9
9
|
|
|
10
10
|
## ✨ Features
|
|
11
11
|
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
| Platform | Status | Features |
|
|
25
25
|
|----------|--------|----------|
|
|
26
26
|
| Discord | ✅ Fully Supported | Messages, Embeds, Reactions, Buttons, Slash Commands |
|
|
27
|
-
| Root |
|
|
27
|
+
| Root | ✅ Fully Supported | Messages, Reactions, Pins, Typing Indicators, File Attachments (via `@rootsdk/server-bot` v0.17.0+) |
|
|
28
28
|
| Others | 📝 Planned | Open to community contributions |
|
|
29
29
|
|
|
30
30
|
## 🚀 Quick Start
|
|
@@ -373,7 +373,7 @@ await client.sendMessage(channelId, {
|
|
|
373
373
|
{ name: 'Field 2', value: 'Value 2', inline: true }
|
|
374
374
|
],
|
|
375
375
|
footer: {
|
|
376
|
-
text: 'Powered by Library.DR-Conversion v0.1.
|
|
376
|
+
text: 'Powered by Library.DR-Conversion v0.1.4'
|
|
377
377
|
},
|
|
378
378
|
timestamp: new Date()
|
|
379
379
|
}]
|
|
@@ -445,7 +445,7 @@ The `examples/` directory contains several sample bots:
|
|
|
445
445
|
|
|
446
446
|
- **simple-bot.ts**: Basic bot with common commands
|
|
447
447
|
- **discord-bot.ts**: Discord-specific features and optimizations
|
|
448
|
-
- **root-bot.ts**: Root platform example
|
|
448
|
+
- **root-bot.ts**: Root platform example with full @rootsdk/server-bot integration
|
|
449
449
|
- **advanced-bot.ts**: Advanced features including error handling, stats tracking, and rich embeds
|
|
450
450
|
|
|
451
451
|
Run an example:
|
|
@@ -484,7 +484,7 @@ Library.DR-Conversion/
|
|
|
484
484
|
│ │ │ ├── converters.ts # Type converters
|
|
485
485
|
│ │ │ └── types.ts # Discord-specific types
|
|
486
486
|
│ │ └── root/
|
|
487
|
-
│ │ ├── provider.ts # Root implementation (
|
|
487
|
+
│ │ ├── provider.ts # Root implementation (fully integrated with @rootsdk/server-bot)
|
|
488
488
|
│ │ ├── converters.ts # Type converters
|
|
489
489
|
│ │ └── types.ts # Root-specific types
|
|
490
490
|
│ ├── utils/
|
|
@@ -691,33 +691,168 @@ MIT License - see [LICENSE](LICENSE) file for details
|
|
|
691
691
|
|
|
692
692
|
## 🙏 Acknowledgments
|
|
693
693
|
|
|
694
|
-
- Built with [discord.js](https://discord.js.org/)
|
|
695
|
-
-
|
|
696
|
-
-
|
|
694
|
+
- **Discord.js** - Built with [discord.js](https://discord.js.org/) for exceptional Discord API support
|
|
695
|
+
- **Root Platform** - For building an innovative chat platform and providing valuable architectural feedback
|
|
696
|
+
- **Skep** - For important discussions on multi-instance architecture and production deployment considerations
|
|
697
|
+
- **TypeScript Community** - For creating an amazing type-safe development experience
|
|
698
|
+
- **Open Source Community** - Inspired by the need for platform-agnostic bot development and unified APIs
|
|
699
|
+
|
|
700
|
+
Special thanks to everyone who provided feedback, testing, and suggestions during development!
|
|
697
701
|
|
|
698
702
|
## 📞 Support
|
|
699
703
|
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
-
|
|
704
|
+
### Getting Help
|
|
705
|
+
|
|
706
|
+
- 📦 **NPM Package**: [library.dr-conversion](https://www.npmjs.com/package/library.dr-conversion)
|
|
707
|
+
- 📖 **API Documentation**: See [API.md](API.md) for detailed API reference
|
|
708
|
+
- 📝 **Examples**: Check the [examples/](examples/) directory for sample bots
|
|
709
|
+
- 🐛 **Bug Reports**: Open an issue on GitHub with reproduction steps
|
|
710
|
+
- 💡 **Feature Requests**: Share your ideas and use cases
|
|
711
|
+
- 💬 **Questions**: Start a discussion or reach out to the community
|
|
712
|
+
|
|
713
|
+
### Contributing
|
|
714
|
+
|
|
715
|
+
Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
716
|
+
|
|
717
|
+
Areas where we'd love help:
|
|
718
|
+
- Root platform advanced features (thread/reply support with parentMessageIds)
|
|
719
|
+
- Additional platform providers (Telegram, Slack, Matrix)
|
|
720
|
+
- Documentation improvements and examples
|
|
721
|
+
- Test coverage expansion
|
|
722
|
+
- Bug fixes and performance optimizations
|
|
723
|
+
- Unified slash commands abstraction
|
|
724
|
+
- Interactive components (buttons, select menus)
|
|
725
|
+
- Unified file upload API abstraction
|
|
726
|
+
|
|
727
|
+
### Community Guidelines
|
|
728
|
+
|
|
729
|
+
- Be respectful and constructive
|
|
730
|
+
- Follow platform-specific terms of service (Discord, Root, etc.)
|
|
731
|
+
- Share knowledge and help other developers
|
|
732
|
+
- Report security vulnerabilities responsibly (see [SECURITY.md](SECURITY.md))
|
|
703
733
|
|
|
704
734
|
## 🗺️ Roadmap
|
|
705
735
|
|
|
706
|
-
|
|
707
|
-
- [
|
|
708
|
-
- [
|
|
709
|
-
- [
|
|
710
|
-
- [
|
|
711
|
-
- [
|
|
712
|
-
- [
|
|
713
|
-
- [
|
|
736
|
+
### ✅ Completed in v0.1.x
|
|
737
|
+
- [x] Full Discord platform implementation via discord.js
|
|
738
|
+
- [x] Type-safe unified API across platforms
|
|
739
|
+
- [x] CLI tool for scaffolding new bot projects
|
|
740
|
+
- [x] Deployment safety controls (`preventAutoStart`, env var blocking)
|
|
741
|
+
- [x] Production environment auto-detection for logging
|
|
742
|
+
- [x] Bidirectional platform conversion support
|
|
743
|
+
- [x] Multi-instance architecture support
|
|
744
|
+
- [x] Rich embeds and message formatting
|
|
745
|
+
- [x] Event forwarding system
|
|
746
|
+
- [x] **Root platform implementation** - Fully integrated with `@rootsdk/server-bot`
|
|
747
|
+
- ✅ Core messaging (send, edit, delete)
|
|
748
|
+
- ✅ Message events (created, edited, deleted)
|
|
749
|
+
- ✅ Channel events (created, edited, deleted)
|
|
750
|
+
- ✅ Community member events (join, leave)
|
|
751
|
+
- ✅ Community update events
|
|
752
|
+
- ✅ Message reactions (add, remove, events)
|
|
753
|
+
- ✅ Message pins (pin, unpin, events)
|
|
754
|
+
- ✅ Typing indicators (send, events)
|
|
755
|
+
- ✅ User, channel, and guild data fetching
|
|
756
|
+
- ✅ Message methods (reply, delete, edit, react)
|
|
757
|
+
- ✅ File attachments (sendMessageWithAttachments for pre-uploaded files)
|
|
758
|
+
|
|
759
|
+
### 🚧 In Progress
|
|
760
|
+
- [ ] Root advanced features
|
|
761
|
+
- ⏳ Thread/reply support (parentMessageIds - SDK ready, not integrated)
|
|
762
|
+
- ⏳ Additional community events (role changes, bans)
|
|
763
|
+
- ⏳ Unified file upload API (abstract platform differences)
|
|
764
|
+
|
|
765
|
+
### 📋 Planned Features
|
|
766
|
+
- [ ] Slash commands abstraction across platforms
|
|
767
|
+
- [ ] Interactive components (buttons, select menus) - unified API
|
|
768
|
+
- [ ] Unified file upload abstraction (handle Discord direct + Root token-based)
|
|
769
|
+
- [ ] Voice channel support (Discord-specific initially)
|
|
770
|
+
- [ ] Webhook support
|
|
771
|
+
- [ ] Rate limiting and queue management
|
|
772
|
+
- [ ] Additional platforms (Telegram, Slack, Matrix)
|
|
773
|
+
- [ ] Comprehensive testing suite (currently 48/52 tests passing)
|
|
774
|
+
|
|
775
|
+
### 🔧 Developer Experience
|
|
776
|
+
- [ ] Interactive documentation site
|
|
777
|
+
- [ ] More example bots (slash commands, buttons, etc.)
|
|
778
|
+
- [ ] Migration guides from platform-specific libraries
|
|
779
|
+
- [ ] VS Code extension for bot development
|
|
780
|
+
- [ ] Debug tools and logging dashboard
|
|
714
781
|
|
|
715
782
|
## ⚠️ Current Limitations
|
|
716
783
|
|
|
717
|
-
|
|
718
|
-
-
|
|
719
|
-
-
|
|
720
|
-
-
|
|
784
|
+
### Platform Support
|
|
785
|
+
- **Discord**: ✅ Fully implemented and tested with `discord.js`
|
|
786
|
+
- **Root**: ✅ Fully implemented with `@rootsdk/server-bot` v0.17.0+
|
|
787
|
+
- ✅ Core messaging (send, edit, delete, reply)
|
|
788
|
+
- ✅ Message events (created, edited, deleted)
|
|
789
|
+
- ✅ Channel events (created, edited, deleted)
|
|
790
|
+
- ✅ Community events (member join/leave, community updates)
|
|
791
|
+
- ✅ Reactions (add, remove, events)
|
|
792
|
+
- ✅ Message pins (pin, unpin, events)
|
|
793
|
+
- ✅ Typing indicators (send, receive events)
|
|
794
|
+
- ✅ File attachments (server can send with pre-uploaded token URIs)
|
|
795
|
+
- ⏳ Thread/reply support (SDK supports parentMessageIds - not yet implemented)
|
|
796
|
+
- 📦 Install: `npm install @rootsdk/server-bot @rootsdk/dev-tools`
|
|
797
|
+
- 📚 See [Root File Upload Architecture](#root-file-upload-architecture) for attachment details
|
|
798
|
+
|
|
799
|
+
### Feature Parity
|
|
800
|
+
- **Core Messaging**: ✅ Full parity (Discord & Root)
|
|
801
|
+
- **Reactions**: ✅ Full parity (Discord & Root)
|
|
802
|
+
- **Pins**: ✅ Full parity (Discord & Root)
|
|
803
|
+
- **Typing Indicators**: ✅ Full parity (Discord & Root)
|
|
804
|
+
- **File Uploads**:
|
|
805
|
+
- Discord: ✅ Direct upload via unified API
|
|
806
|
+
- Root: ✅ Server-side sending with pre-uploaded tokens (see below)
|
|
807
|
+
- **Embeds**: Discord rich embeds supported, Root does not support Discord-style embeds
|
|
808
|
+
- **Slash Commands**: Platform-specific registration required (no unified abstraction yet)
|
|
809
|
+
- **Voice Channels**: Discord-only (Root uses WebRTC, different architecture)
|
|
810
|
+
- **Interactive Components**: Buttons and select menus not yet abstracted
|
|
811
|
+
- **Webhooks**: Not yet supported on either platform
|
|
812
|
+
|
|
813
|
+
### Root File Upload Architecture
|
|
814
|
+
|
|
815
|
+
Root uses a **client-server split architecture** for file uploads:
|
|
816
|
+
|
|
817
|
+
**Client-Side (Upload):**
|
|
818
|
+
1. Client requests upload token from Root API (via `@rootsdk/client-app`)
|
|
819
|
+
2. Client uploads file directly to Root's storage using the token
|
|
820
|
+
3. Client receives a token URI after successful upload
|
|
821
|
+
|
|
822
|
+
**Server-Side (Messaging):**
|
|
823
|
+
```typescript
|
|
824
|
+
// Server bot uses pre-uploaded token URIs to attach files to messages
|
|
825
|
+
const message = await rootClient.sendMessageWithAttachments(
|
|
826
|
+
channelId,
|
|
827
|
+
'Check out these files!',
|
|
828
|
+
['token://file-uri-1', 'token://file-uri-2'] // From client upload
|
|
829
|
+
);
|
|
830
|
+
```
|
|
831
|
+
|
|
832
|
+
**Why This Architecture?**
|
|
833
|
+
- Security: Clients upload directly to storage (no server bottleneck)
|
|
834
|
+
- Scalability: Distributed upload load across clients
|
|
835
|
+
- Bandwidth: Server doesn't proxy large files
|
|
836
|
+
- The `@rootsdk/server-bot` package intentionally does not expose upload token generation
|
|
837
|
+
|
|
838
|
+
**Implementation Options:**
|
|
839
|
+
1. **Hybrid Bot**: Use `@rootsdk/client-app` alongside server-bot for full file support
|
|
840
|
+
2. **Pure Server Bot**: Accept pre-uploaded token URIs from your application's client
|
|
841
|
+
3. **Custom Integration**: Integrate with Root's upload API directly
|
|
842
|
+
|
|
843
|
+
For most use cases, accepting token URIs from clients is the recommended approach.
|
|
844
|
+
|
|
845
|
+
### Known Issues
|
|
846
|
+
- Some test files have module resolution issues (3/52 test suites)
|
|
847
|
+
- TypeScript strict mode requires careful handling of environment variables
|
|
848
|
+
- Root file uploads require client-side token generation (architectural design, not a limitation)
|
|
849
|
+
- Root does not support Discord-style rich embeds (platform design difference)
|
|
850
|
+
|
|
851
|
+
### Deployment Notes
|
|
852
|
+
- Set `NODE_ENV=production` for automatic production logging
|
|
853
|
+
- Use `ALLOW_{PLATFORM}_BOT=false` to disable unwanted bots
|
|
854
|
+
- Root's multi-instance architecture requires one client per community
|
|
855
|
+
- Discord bots should comply with Discord's rate limits and data privacy guidelines
|
|
721
856
|
|
|
722
857
|
---
|
|
723
858
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ChannelMessage, CommunityMember, Channel as RootChannel, Community } from '@rootsdk/server-bot';
|
|
2
|
+
import { Message, User, Channel, Guild } from '../../types/common';
|
|
3
|
+
import { MessageOptions } from '../../types/embeds';
|
|
3
4
|
import type { RootProvider } from './provider';
|
|
4
|
-
|
|
5
|
-
export declare function
|
|
6
|
-
export declare function
|
|
7
|
-
export declare function
|
|
8
|
-
export declare function
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export declare function toRootMessageOptions(options: MessageOptions): Record<string, unknown>;
|
|
5
|
+
export declare function convertMessageToGeneric(rootMsg: ChannelMessage, provider: RootProvider): Message;
|
|
6
|
+
export declare function convertUserToGeneric(member: CommunityMember): User;
|
|
7
|
+
export declare function convertChannelToGeneric(rootChannel: RootChannel): Channel;
|
|
8
|
+
export declare function convertGuildToGeneric(community: Community): Guild;
|
|
9
|
+
export declare function toRootMessageOptions(options: MessageOptions): {
|
|
10
|
+
content?: string;
|
|
11
|
+
attachmentTokenUris?: string[];
|
|
12
|
+
};
|
|
13
13
|
//# sourceMappingURL=converters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"converters.d.ts","sourceRoot":"","sources":["../../../src/providers/root/converters.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,OAAO,EACP,IAAI,EACJ,OAAO,EACP,KAAK,
|
|
1
|
+
{"version":3,"file":"converters.d.ts","sourceRoot":"","sources":["../../../src/providers/root/converters.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,cAAc,EACd,eAAe,EACf,OAAO,IAAI,WAAW,EACtB,SAAS,EACV,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,OAAO,EACP,IAAI,EACJ,OAAO,EACP,KAAK,EAGN,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAK/C,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,YAAY,GAAG,OAAO,CAsDhG;AAKD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CASlE;AAKD,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAQzE;AAwBD,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,SAAS,GAAG,KAAK,CAUjE;AAwBD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,cAAc,GAAG;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;CAChC,CA0BA"}
|
|
@@ -1,214 +1,107 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
5
|
-
exports.
|
|
6
|
-
exports.
|
|
7
|
-
exports.toGenericAttachment = toGenericAttachment;
|
|
8
|
-
exports.toGenericEmbed = toGenericEmbed;
|
|
9
|
-
exports.toRootEmbed = toRootEmbed;
|
|
3
|
+
exports.convertMessageToGeneric = convertMessageToGeneric;
|
|
4
|
+
exports.convertUserToGeneric = convertUserToGeneric;
|
|
5
|
+
exports.convertChannelToGeneric = convertChannelToGeneric;
|
|
6
|
+
exports.convertGuildToGeneric = convertGuildToGeneric;
|
|
10
7
|
exports.toRootMessageOptions = toRootMessageOptions;
|
|
11
|
-
function
|
|
8
|
+
function convertMessageToGeneric(rootMsg, provider) {
|
|
12
9
|
const message = {
|
|
13
10
|
id: rootMsg.id,
|
|
14
|
-
content: rootMsg.
|
|
15
|
-
author:
|
|
11
|
+
content: rootMsg.messageContent || '',
|
|
12
|
+
author: {
|
|
13
|
+
id: rootMsg.userId,
|
|
14
|
+
username: 'user',
|
|
15
|
+
displayName: 'User',
|
|
16
|
+
bot: false,
|
|
17
|
+
platform: 'root'
|
|
18
|
+
},
|
|
16
19
|
channel: {
|
|
17
20
|
id: rootMsg.channelId,
|
|
18
|
-
name: '
|
|
21
|
+
name: 'Channel',
|
|
19
22
|
type: 'text',
|
|
20
23
|
platform: 'root'
|
|
21
24
|
},
|
|
22
|
-
timestamp: new Date(
|
|
25
|
+
timestamp: new Date(),
|
|
23
26
|
platform: 'root',
|
|
24
|
-
embeds:
|
|
25
|
-
attachments: rootMsg.
|
|
26
|
-
? rootMsg.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
displayName: 'User',
|
|
33
|
-
bot: false,
|
|
34
|
-
platform: 'root'
|
|
27
|
+
embeds: [],
|
|
28
|
+
attachments: rootMsg.messageUris && rootMsg.messageUris.length > 0
|
|
29
|
+
? rootMsg.messageUris.map(uri => ({
|
|
30
|
+
id: uri.uri,
|
|
31
|
+
url: uri.uri,
|
|
32
|
+
filename: uri.attachment?.fileName || 'file',
|
|
33
|
+
size: Number(uri.attachment?.length || 0),
|
|
34
|
+
contentType: uri.attachment?.mimeType
|
|
35
35
|
}))
|
|
36
36
|
: undefined,
|
|
37
|
+
mentions: undefined,
|
|
37
38
|
async reply(content) {
|
|
38
|
-
return provider.sendMessage(rootMsg.channelId, content);
|
|
39
|
+
return await provider.sendMessage(String(rootMsg.channelId), content);
|
|
39
40
|
},
|
|
40
41
|
async delete() {
|
|
41
|
-
await provider.deleteMessage(rootMsg.id, rootMsg.channelId);
|
|
42
|
+
await provider.deleteMessage(String(rootMsg.id), String(rootMsg.channelId));
|
|
42
43
|
},
|
|
43
44
|
async edit(content) {
|
|
44
|
-
return provider.editMessage(rootMsg.id, rootMsg.channelId, content);
|
|
45
|
+
return await provider.editMessage(String(rootMsg.id), String(rootMsg.channelId), content);
|
|
45
46
|
},
|
|
46
|
-
async react(
|
|
47
|
-
|
|
48
|
-
return Promise.resolve();
|
|
47
|
+
async react(emoji) {
|
|
48
|
+
await provider.reactToMessage(String(rootMsg.id), String(rootMsg.channelId), emoji);
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
51
|
return message;
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function convertUserToGeneric(member) {
|
|
54
54
|
return {
|
|
55
|
-
id:
|
|
56
|
-
username:
|
|
57
|
-
displayName:
|
|
58
|
-
avatarUrl:
|
|
59
|
-
bot:
|
|
55
|
+
id: member.userId,
|
|
56
|
+
username: member.nickname,
|
|
57
|
+
displayName: member.nickname,
|
|
58
|
+
avatarUrl: member.profilePictureAssetUri,
|
|
59
|
+
bot: false,
|
|
60
60
|
platform: 'root'
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function convertChannelToGeneric(rootChannel) {
|
|
64
64
|
return {
|
|
65
65
|
id: rootChannel.id,
|
|
66
66
|
name: rootChannel.name,
|
|
67
|
-
type: convertChannelType(rootChannel.
|
|
67
|
+
type: convertChannelType(rootChannel.channelType),
|
|
68
68
|
platform: 'root',
|
|
69
|
-
topic: rootChannel.
|
|
69
|
+
topic: rootChannel.description
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
|
-
function convertChannelType(
|
|
73
|
-
switch (
|
|
74
|
-
case
|
|
75
|
-
case
|
|
72
|
+
function convertChannelType(channelType) {
|
|
73
|
+
switch (channelType) {
|
|
74
|
+
case 1:
|
|
75
|
+
case 2:
|
|
76
76
|
return 'text';
|
|
77
|
-
case
|
|
78
|
-
return 'voice';
|
|
79
|
-
case 'dm':
|
|
80
|
-
case 'direct':
|
|
81
|
-
return 'dm';
|
|
82
|
-
case 'group':
|
|
83
|
-
return 'group';
|
|
77
|
+
case 0:
|
|
84
78
|
default:
|
|
85
79
|
return 'text';
|
|
86
80
|
}
|
|
87
81
|
}
|
|
88
|
-
function
|
|
82
|
+
function convertGuildToGeneric(community) {
|
|
89
83
|
return {
|
|
90
|
-
id:
|
|
91
|
-
name:
|
|
92
|
-
iconUrl:
|
|
93
|
-
memberCount:
|
|
84
|
+
id: community.communityId,
|
|
85
|
+
name: community.name,
|
|
86
|
+
iconUrl: community.pictureAssetUri,
|
|
87
|
+
memberCount: undefined,
|
|
94
88
|
platform: 'root',
|
|
95
|
-
description:
|
|
96
|
-
ownerId:
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
function toGenericAttachment(rootAttachment) {
|
|
100
|
-
return {
|
|
101
|
-
id: rootAttachment.id,
|
|
102
|
-
filename: rootAttachment.filename,
|
|
103
|
-
size: rootAttachment.size,
|
|
104
|
-
url: rootAttachment.url,
|
|
105
|
-
contentType: rootAttachment.contentType,
|
|
106
|
-
width: rootAttachment.width,
|
|
107
|
-
height: rootAttachment.height
|
|
89
|
+
description: undefined,
|
|
90
|
+
ownerId: community.ownerUserId
|
|
108
91
|
};
|
|
109
92
|
}
|
|
110
|
-
function toGenericEmbed(rootEmbed) {
|
|
111
|
-
const embed = {};
|
|
112
|
-
if (typeof rootEmbed.title === 'string')
|
|
113
|
-
embed.title = rootEmbed.title;
|
|
114
|
-
if (typeof rootEmbed.description === 'string')
|
|
115
|
-
embed.description = rootEmbed.description;
|
|
116
|
-
if (typeof rootEmbed.url === 'string')
|
|
117
|
-
embed.url = rootEmbed.url;
|
|
118
|
-
if (typeof rootEmbed.color === 'number')
|
|
119
|
-
embed.color = rootEmbed.color;
|
|
120
|
-
if (typeof rootEmbed.timestamp === 'string')
|
|
121
|
-
embed.timestamp = new Date(rootEmbed.timestamp);
|
|
122
|
-
if (Array.isArray(rootEmbed.fields) && rootEmbed.fields.length > 0) {
|
|
123
|
-
embed.fields = rootEmbed.fields.map((f) => ({
|
|
124
|
-
name: String(f.name),
|
|
125
|
-
value: String(f.value),
|
|
126
|
-
inline: Boolean(f.inline)
|
|
127
|
-
}));
|
|
128
|
-
}
|
|
129
|
-
if (rootEmbed.footer) {
|
|
130
|
-
embed.footer = {
|
|
131
|
-
text: String(rootEmbed.footer.text),
|
|
132
|
-
iconUrl: typeof rootEmbed.footer.iconUrl === 'string' ? rootEmbed.footer.iconUrl : undefined
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
if (rootEmbed.image) {
|
|
136
|
-
embed.image = {
|
|
137
|
-
url: String(rootEmbed.image.url),
|
|
138
|
-
width: typeof rootEmbed.image.width === 'number' ? rootEmbed.image.width : undefined,
|
|
139
|
-
height: typeof rootEmbed.image.height === 'number' ? rootEmbed.image.height : undefined
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
if (rootEmbed.thumbnail) {
|
|
143
|
-
embed.thumbnail = {
|
|
144
|
-
url: String(rootEmbed.thumbnail.url),
|
|
145
|
-
width: typeof rootEmbed.thumbnail.width === 'number' ? rootEmbed.thumbnail.width : undefined,
|
|
146
|
-
height: typeof rootEmbed.thumbnail.height === 'number' ? rootEmbed.thumbnail.height : undefined
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
if (rootEmbed.author) {
|
|
150
|
-
embed.author = {
|
|
151
|
-
name: String(rootEmbed.author.name),
|
|
152
|
-
iconUrl: typeof rootEmbed.author.iconUrl === 'string' ? rootEmbed.author.iconUrl : undefined,
|
|
153
|
-
url: typeof rootEmbed.author.url === 'string' ? rootEmbed.author.url : undefined
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
return embed;
|
|
157
|
-
}
|
|
158
|
-
function toRootEmbed(embed) {
|
|
159
|
-
const rootEmbed = {};
|
|
160
|
-
if (embed.title)
|
|
161
|
-
rootEmbed['title'] = embed.title;
|
|
162
|
-
if (embed.description)
|
|
163
|
-
rootEmbed['description'] = embed.description;
|
|
164
|
-
if (embed.url)
|
|
165
|
-
rootEmbed['url'] = embed.url;
|
|
166
|
-
if (embed.color) {
|
|
167
|
-
rootEmbed['color'] = typeof embed.color === 'string'
|
|
168
|
-
? parseInt(embed.color.replace('#', ''), 16)
|
|
169
|
-
: embed.color;
|
|
170
|
-
}
|
|
171
|
-
if (embed.fields && embed.fields.length > 0) {
|
|
172
|
-
rootEmbed['fields'] = embed.fields;
|
|
173
|
-
}
|
|
174
|
-
if (embed.footer) {
|
|
175
|
-
rootEmbed['footer'] = {
|
|
176
|
-
text: embed.footer.text,
|
|
177
|
-
icon_url: embed.footer.iconUrl
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
if (embed.image) {
|
|
181
|
-
rootEmbed['image'] = { url: embed.image.url };
|
|
182
|
-
}
|
|
183
|
-
if (embed.thumbnail) {
|
|
184
|
-
rootEmbed['thumbnail'] = { url: embed.thumbnail.url };
|
|
185
|
-
}
|
|
186
|
-
if (embed.author) {
|
|
187
|
-
rootEmbed['author'] = {
|
|
188
|
-
name: embed.author.name,
|
|
189
|
-
icon_url: embed.author.iconUrl,
|
|
190
|
-
url: embed.author.url
|
|
191
|
-
};
|
|
192
|
-
}
|
|
193
|
-
if (embed.timestamp) {
|
|
194
|
-
rootEmbed['timestamp'] = embed.timestamp.toISOString();
|
|
195
|
-
}
|
|
196
|
-
return rootEmbed;
|
|
197
|
-
}
|
|
198
93
|
function toRootMessageOptions(options) {
|
|
199
94
|
const rootOptions = {};
|
|
200
95
|
if (options.content) {
|
|
201
|
-
rootOptions
|
|
202
|
-
}
|
|
203
|
-
if (options.embeds && options.embeds.length > 0) {
|
|
204
|
-
rootOptions['embeds'] = options.embeds.map(toRootEmbed);
|
|
96
|
+
rootOptions.content = options.content;
|
|
205
97
|
}
|
|
206
98
|
if (options.files && options.files.length > 0) {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
99
|
+
throw new Error('File attachments in Root require client-side upload token generation. ' +
|
|
100
|
+
'The @rootsdk/server-bot package does not expose upload token APIs. ' +
|
|
101
|
+
'Use @rootsdk/client-app for file uploads, or integrate with Root\'s upload API directly.');
|
|
102
|
+
}
|
|
103
|
+
if (options.embeds && options.embeds.length > 0) {
|
|
104
|
+
throw new Error('Rich embeds are not supported by Root platform');
|
|
212
105
|
}
|
|
213
106
|
return rootOptions;
|
|
214
107
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"converters.js","sourceRoot":"","sources":["../../../src/providers/root/converters.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"converters.js","sourceRoot":"","sources":["../../../src/providers/root/converters.ts"],"names":[],"mappings":";;AAyBA,0DAsDC;AAKD,oDASC;AAKD,0DAQC;AAwBD,sDAUC;AAwBD,oDA6BC;AAxKD,SAAgB,uBAAuB,CAAC,OAAuB,EAAE,QAAsB;IACrF,MAAM,OAAO,GAAY;QACvB,EAAE,EAAE,OAAO,CAAC,EAAE;QACd,OAAO,EAAE,OAAO,CAAC,cAAc,IAAI,EAAE;QACrC,MAAM,EAAE;YACN,EAAE,EAAE,OAAO,CAAC,MAAM;YAClB,QAAQ,EAAE,MAAM;YAChB,WAAW,EAAE,MAAM;YACnB,GAAG,EAAE,KAAK;YACV,QAAQ,EAAE,MAAM;SACjB;QACD,OAAO,EAAE;YACP,EAAE,EAAE,OAAO,CAAC,SAAS;YACrB,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,MAAM;YACZ,QAAQ,EAAE,MAAM;SACjB;QACD,SAAS,EAAE,IAAI,IAAI,EAAE;QACrB,QAAQ,EAAE,MAAM;QAChB,MAAM,EAAE,EAAE;QACV,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,OAAO,C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AC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9C,MAAM,IAAI,KAAK,CACb,wEAAwE;YACxE,qEAAqE;YACrE,0FAA0F,CAC3F,CAAC;IACJ,CAAC;IAGD,IAAI,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAChD,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;IACpE,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RootServer, ChannelMessage, CommunityMember, Channel as RootChannel, Community } from '@rootsdk/server-bot';
|
|
1
2
|
import { BaseProvider } from '../base';
|
|
2
3
|
import { Message, User, Channel, Guild } from '../../types/common';
|
|
3
4
|
import { MessageOptions } from '../../types/embeds';
|
|
@@ -8,18 +9,28 @@ export declare class RootProvider extends BaseProvider {
|
|
|
8
9
|
readonly platformVersion = "1.0.0";
|
|
9
10
|
constructor(config: RootConfig);
|
|
10
11
|
private setupEventListeners;
|
|
12
|
+
private handleChannelCreated;
|
|
13
|
+
private handleChannelEdited;
|
|
14
|
+
private handleMemberJoined;
|
|
15
|
+
private handleCommunityEdited;
|
|
11
16
|
connect(): Promise<void>;
|
|
12
17
|
disconnect(): Promise<void>;
|
|
13
|
-
sendMessage(
|
|
14
|
-
|
|
15
|
-
|
|
18
|
+
sendMessage(channelId: string, options: string | MessageOptions): Promise<Message>;
|
|
19
|
+
sendMessageWithAttachments(channelId: string, content: string, attachmentTokenUris: string[]): Promise<Message>;
|
|
20
|
+
editMessage(messageId: string, channelId: string, content: string): Promise<Message>;
|
|
21
|
+
deleteMessage(messageId: string, channelId: string): Promise<void>;
|
|
22
|
+
reactToMessage(messageId: string, channelId: string, emoji: string): Promise<void>;
|
|
23
|
+
removeReaction(messageId: string, channelId: string, emoji: string): Promise<void>;
|
|
24
|
+
pinMessage(messageId: string, channelId: string): Promise<void>;
|
|
25
|
+
unpinMessage(messageId: string, channelId: string): Promise<void>;
|
|
26
|
+
sendTyping(channelId: string, isTyping?: boolean): Promise<void>;
|
|
16
27
|
getUser(userId: string): Promise<User>;
|
|
17
28
|
getChannel(channelId: string): Promise<Channel>;
|
|
18
|
-
getGuild(
|
|
19
|
-
convertMessage(rootMsg:
|
|
20
|
-
convertUser(rootUser:
|
|
21
|
-
convertChannel(rootChannel:
|
|
22
|
-
convertGuild(rootCommunity:
|
|
23
|
-
getClient():
|
|
29
|
+
getGuild(_guildId: string): Promise<Guild>;
|
|
30
|
+
convertMessage(rootMsg: ChannelMessage): Message;
|
|
31
|
+
convertUser(rootUser: CommunityMember): User;
|
|
32
|
+
convertChannel(rootChannel: RootChannel): Channel;
|
|
33
|
+
convertGuild(rootCommunity: Community): Guild;
|
|
34
|
+
getClient(): RootServer;
|
|
24
35
|
}
|
|
25
36
|
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/providers/root/provider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/providers/root/provider.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,UAAU,EAmBV,cAAc,EACd,eAAe,EACf,OAAO,IAAI,WAAW,EACtB,SAAS,EAIV,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAQrC,qBAAa,YAAa,SAAQ,YAAY;IAC5C,OAAO,CAAC,MAAM,CAAa;IAC3B,QAAQ,CAAC,YAAY,UAAU;IAC/B,QAAQ,CAAC,eAAe,WAAW;gBAEvB,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EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAW/C,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;IAWhD,cAAc,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO;IAOhD,WAAW,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI;IAO5C,cAAc,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO;IAOjD,YAAY,CAAC,aAAa,EAAE,SAAS,GAAG,KAAK;IAO7C,SAAS,IAAI,UAAU;CAGxB"}
|
|
@@ -34,81 +34,319 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.RootProvider = void 0;
|
|
37
|
+
const server_bot_1 = require("@rootsdk/server-bot");
|
|
37
38
|
const base_1 = require("../base");
|
|
38
39
|
const Converters = __importStar(require("./converters"));
|
|
39
40
|
const errors_1 = require("../../utils/errors");
|
|
40
41
|
class RootProvider extends base_1.BaseProvider {
|
|
41
42
|
constructor(config) {
|
|
42
43
|
super(config);
|
|
43
|
-
this.client = null;
|
|
44
44
|
this.platformName = 'root';
|
|
45
45
|
this.platformVersion = '1.0.0';
|
|
46
46
|
this.initLogger();
|
|
47
47
|
this.validateConfig('token');
|
|
48
|
-
this.
|
|
48
|
+
this.client = server_bot_1.rootServer;
|
|
49
|
+
this.logger.info('Root provider initialized with @rootsdk/server-bot');
|
|
49
50
|
this.setupEventListeners();
|
|
50
51
|
}
|
|
51
52
|
setupEventListeners() {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
this.client.community.channelMessages.on(server_bot_1.ChannelMessageEvent.ChannelMessageCreated, (event) => {
|
|
54
|
+
try {
|
|
55
|
+
const message = Converters.convertMessageToGeneric(event, this);
|
|
56
|
+
this.emitGenericEvent('message', message);
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
this.handleError(error, 'Message created event');
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
this.client.community.channelMessages.on(server_bot_1.ChannelMessageEvent.ChannelMessageEdited, (event) => {
|
|
63
|
+
try {
|
|
64
|
+
const message = Converters.convertMessageToGeneric(event, this);
|
|
65
|
+
this.emitGenericEvent('messageUpdate', message, message);
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
this.handleError(error, 'Message edited event');
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
this.client.community.channelMessages.on(server_bot_1.ChannelMessageEvent.ChannelMessageDeleted, (event) => {
|
|
72
|
+
try {
|
|
73
|
+
this.emitGenericEvent('messageDelete', { id: event.id });
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
this.handleError(error, 'Message deleted event');
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
this.client.community.channelMessages.on(server_bot_1.ChannelMessageEvent.ChannelMessageReactionCreated, (event) => {
|
|
55
80
|
try {
|
|
56
|
-
this.logger.
|
|
57
|
-
this._isConnected = true;
|
|
58
|
-
this.emitGenericEvent('ready');
|
|
59
|
-
this.logger.info('Connected to Root (stub mode)');
|
|
60
|
-
resolve();
|
|
81
|
+
this.logger.debug(`Reaction added: ${event.shortcode} on message ${event.messageId}`);
|
|
61
82
|
}
|
|
62
83
|
catch (error) {
|
|
63
|
-
this.
|
|
64
|
-
reject(new errors_1.AuthenticationError('root', error.message));
|
|
84
|
+
this.handleError(error, 'Reaction created event');
|
|
65
85
|
}
|
|
66
86
|
});
|
|
87
|
+
this.client.community.channelMessages.on(server_bot_1.ChannelMessageEvent.ChannelMessageReactionDeleted, (event) => {
|
|
88
|
+
try {
|
|
89
|
+
this.logger.debug(`Reaction removed: ${event.shortcode} from message ${event.messageId}`);
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
this.handleError(error, 'Reaction deleted event');
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
this.client.community.channelMessages.on(server_bot_1.ChannelMessageEvent.ChannelMessagePinCreated, (event) => {
|
|
96
|
+
try {
|
|
97
|
+
this.logger.debug(`Message pinned: ${event.messageId} in channel ${event.channelId}`);
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
this.handleError(error, 'Message pin created event');
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
this.client.community.channelMessages.on(server_bot_1.ChannelMessageEvent.ChannelMessagePinDeleted, (event) => {
|
|
104
|
+
try {
|
|
105
|
+
this.logger.debug(`Message unpinned: ${event.messageId} from channel ${event.channelId}`);
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
this.handleError(error, 'Message pin deleted event');
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
this.client.community.channelMessages.on(server_bot_1.ChannelMessageEvent.ChannelMessageSetTypingIndicator, (event) => {
|
|
112
|
+
try {
|
|
113
|
+
const channel = {
|
|
114
|
+
id: String(event.channelId),
|
|
115
|
+
name: 'Channel',
|
|
116
|
+
type: 'text',
|
|
117
|
+
platform: 'root'
|
|
118
|
+
};
|
|
119
|
+
const user = {
|
|
120
|
+
id: String(event.userId),
|
|
121
|
+
username: 'User',
|
|
122
|
+
displayName: 'User',
|
|
123
|
+
bot: false,
|
|
124
|
+
platform: 'root'
|
|
125
|
+
};
|
|
126
|
+
this.emitGenericEvent('typingStart', channel, user);
|
|
127
|
+
}
|
|
128
|
+
catch (error) {
|
|
129
|
+
this.handleError(error, 'Typing indicator event');
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
this.client.community.channels.on(server_bot_1.ChannelEvent.ChannelCreated, (event) => {
|
|
133
|
+
this.handleChannelCreated(event).catch((error) => {
|
|
134
|
+
this.handleError(error, 'Channel created event');
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
this.client.community.channels.on(server_bot_1.ChannelEvent.ChannelEdited, (event) => {
|
|
138
|
+
this.handleChannelEdited(event).catch((error) => {
|
|
139
|
+
this.handleError(error, 'Channel edited event');
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
this.client.community.channels.on(server_bot_1.ChannelEvent.ChannelDeleted, (event) => {
|
|
143
|
+
try {
|
|
144
|
+
const genericChannel = {
|
|
145
|
+
id: String(event.id),
|
|
146
|
+
name: 'Deleted Channel',
|
|
147
|
+
type: 'text',
|
|
148
|
+
platform: 'root'
|
|
149
|
+
};
|
|
150
|
+
this.emitGenericEvent('channelDelete', genericChannel);
|
|
151
|
+
}
|
|
152
|
+
catch (error) {
|
|
153
|
+
this.handleError(error, 'Channel deleted event');
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
this.client.community.communityMembers.on(server_bot_1.CommunityMemberEvent.CommunityMemberAttach, (event) => {
|
|
157
|
+
this.handleMemberJoined(event).catch((error) => {
|
|
158
|
+
this.handleError(error, 'Member attach event');
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
this.client.community.communityMembers.on(server_bot_1.CommunityMemberEvent.CommunityMemberDetach, (event) => {
|
|
162
|
+
try {
|
|
163
|
+
const genericMember = {
|
|
164
|
+
user: {
|
|
165
|
+
id: String(event.userId),
|
|
166
|
+
username: 'User',
|
|
167
|
+
displayName: 'User',
|
|
168
|
+
bot: false,
|
|
169
|
+
platform: 'root'
|
|
170
|
+
},
|
|
171
|
+
platform: 'root'
|
|
172
|
+
};
|
|
173
|
+
this.emitGenericEvent('guildMemberRemove', genericMember);
|
|
174
|
+
}
|
|
175
|
+
catch (error) {
|
|
176
|
+
this.handleError(error, 'Member detach event');
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
this.client.community.communities.on(server_bot_1.CommunityEvent.CommunityEdited, (_event) => {
|
|
180
|
+
this.handleCommunityEdited().catch((error) => {
|
|
181
|
+
this.handleError(error, 'Community edited event');
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
this.logger.info('Root event listeners configured');
|
|
185
|
+
}
|
|
186
|
+
async handleChannelCreated(event) {
|
|
187
|
+
const channel = await this.client.community.channels.get({ id: event.id });
|
|
188
|
+
const genericChannel = Converters.convertChannelToGeneric(channel);
|
|
189
|
+
this.emitGenericEvent('channelCreate', genericChannel);
|
|
190
|
+
}
|
|
191
|
+
async handleChannelEdited(event) {
|
|
192
|
+
const channel = await this.client.community.channels.get({ id: event.id });
|
|
193
|
+
const genericChannel = Converters.convertChannelToGeneric(channel);
|
|
194
|
+
this.emitGenericEvent('channelUpdate', genericChannel, genericChannel);
|
|
195
|
+
}
|
|
196
|
+
async handleMemberJoined(event) {
|
|
197
|
+
const member = await this.client.community.communityMembers.get({ userId: event.userId });
|
|
198
|
+
const community = await this.client.community.communities.get();
|
|
199
|
+
const genericMember = {
|
|
200
|
+
user: Converters.convertUserToGeneric(member),
|
|
201
|
+
guild: Converters.convertGuildToGeneric(community),
|
|
202
|
+
platform: 'root'
|
|
203
|
+
};
|
|
204
|
+
this.emitGenericEvent('guildMemberAdd', genericMember);
|
|
205
|
+
}
|
|
206
|
+
async handleCommunityEdited() {
|
|
207
|
+
const community = await this.client.community.communities.get();
|
|
208
|
+
const genericGuild = Converters.convertGuildToGeneric(community);
|
|
209
|
+
this.emitGenericEvent('guildUpdate', genericGuild, genericGuild);
|
|
210
|
+
}
|
|
211
|
+
async connect() {
|
|
212
|
+
try {
|
|
213
|
+
this.logger.info('Connecting to Root...');
|
|
214
|
+
await this.client.lifecycle.start();
|
|
215
|
+
this._isConnected = true;
|
|
216
|
+
this.emitGenericEvent('ready');
|
|
217
|
+
this.logger.info('Connected to Root successfully');
|
|
218
|
+
}
|
|
219
|
+
catch (error) {
|
|
220
|
+
this._isConnected = false;
|
|
221
|
+
throw new errors_1.AuthenticationError('root', error.message);
|
|
222
|
+
}
|
|
67
223
|
}
|
|
68
224
|
async disconnect() {
|
|
69
225
|
this.logger.info('Disconnecting from Root...');
|
|
226
|
+
await this.client.lifecycle.stop();
|
|
70
227
|
this._isConnected = false;
|
|
71
228
|
this.logger.info('Disconnected from Root');
|
|
72
|
-
return Promise.resolve();
|
|
73
229
|
}
|
|
74
|
-
sendMessage(
|
|
230
|
+
async sendMessage(channelId, options) {
|
|
231
|
+
this.ensureConnected();
|
|
232
|
+
const messageOptions = typeof options === 'string'
|
|
233
|
+
? { content: options }
|
|
234
|
+
: options;
|
|
235
|
+
const rootOptions = Converters.toRootMessageOptions(messageOptions);
|
|
236
|
+
if (!rootOptions.content) {
|
|
237
|
+
throw new Error('Message content is required');
|
|
238
|
+
}
|
|
239
|
+
try {
|
|
240
|
+
const rootMessage = await this.client.community.channelMessages.create({
|
|
241
|
+
channelId: channelId,
|
|
242
|
+
...rootOptions
|
|
243
|
+
});
|
|
244
|
+
return Converters.convertMessageToGeneric(rootMessage, this);
|
|
245
|
+
}
|
|
246
|
+
catch (error) {
|
|
247
|
+
throw new Error(`Failed to send message: ${error.message}`);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
async sendMessageWithAttachments(channelId, content, attachmentTokenUris) {
|
|
75
251
|
this.ensureConnected();
|
|
76
|
-
|
|
252
|
+
if (!content && attachmentTokenUris.length === 0) {
|
|
253
|
+
throw new Error('Message must have content or attachments');
|
|
254
|
+
}
|
|
255
|
+
try {
|
|
256
|
+
const rootMessage = await this.client.community.channelMessages.create({
|
|
257
|
+
channelId: channelId,
|
|
258
|
+
content,
|
|
259
|
+
attachmentTokenUris
|
|
260
|
+
});
|
|
261
|
+
return Converters.convertMessageToGeneric(rootMessage, this);
|
|
262
|
+
}
|
|
263
|
+
catch (error) {
|
|
264
|
+
throw new Error(`Failed to send message with attachments: ${error.message}`);
|
|
265
|
+
}
|
|
77
266
|
}
|
|
78
|
-
editMessage(
|
|
267
|
+
async editMessage(messageId, channelId, content) {
|
|
79
268
|
this.ensureConnected();
|
|
80
|
-
|
|
269
|
+
const editedMsg = await this.client.community.channelMessages.edit({
|
|
270
|
+
channelId: channelId,
|
|
271
|
+
id: messageId,
|
|
272
|
+
content
|
|
273
|
+
});
|
|
274
|
+
return Converters.convertMessageToGeneric(editedMsg, this);
|
|
275
|
+
}
|
|
276
|
+
async deleteMessage(messageId, channelId) {
|
|
277
|
+
this.ensureConnected();
|
|
278
|
+
await this.client.community.channelMessages.delete({
|
|
279
|
+
channelId: channelId,
|
|
280
|
+
id: messageId
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
async reactToMessage(messageId, channelId, emoji) {
|
|
284
|
+
this.ensureConnected();
|
|
285
|
+
await this.client.community.channelMessages.reactionCreate({
|
|
286
|
+
channelId: channelId,
|
|
287
|
+
messageId: messageId,
|
|
288
|
+
shortcode: emoji
|
|
289
|
+
});
|
|
81
290
|
}
|
|
82
|
-
|
|
291
|
+
async removeReaction(messageId, channelId, emoji) {
|
|
83
292
|
this.ensureConnected();
|
|
84
|
-
|
|
293
|
+
await this.client.community.channelMessages.reactionDelete({
|
|
294
|
+
channelId: channelId,
|
|
295
|
+
messageId: messageId,
|
|
296
|
+
shortcode: emoji
|
|
297
|
+
});
|
|
85
298
|
}
|
|
86
|
-
|
|
299
|
+
async pinMessage(messageId, channelId) {
|
|
87
300
|
this.ensureConnected();
|
|
88
|
-
|
|
301
|
+
await this.client.community.channelMessages.pinCreate({
|
|
302
|
+
channelId: channelId,
|
|
303
|
+
messageId: messageId
|
|
304
|
+
});
|
|
89
305
|
}
|
|
90
|
-
|
|
306
|
+
async unpinMessage(messageId, channelId) {
|
|
91
307
|
this.ensureConnected();
|
|
92
|
-
|
|
308
|
+
await this.client.community.channelMessages.pinDelete({
|
|
309
|
+
channelId: channelId,
|
|
310
|
+
messageId: messageId
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
async sendTyping(channelId, isTyping = true) {
|
|
314
|
+
this.ensureConnected();
|
|
315
|
+
await this.client.community.channelMessages.setTypingIndicator({
|
|
316
|
+
channelId: channelId,
|
|
317
|
+
isTyping
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
async getUser(userId) {
|
|
321
|
+
this.ensureConnected();
|
|
322
|
+
const member = await this.client.community.communityMembers.get({
|
|
323
|
+
userId: userId
|
|
324
|
+
});
|
|
325
|
+
return Converters.convertUserToGeneric(member);
|
|
326
|
+
}
|
|
327
|
+
async getChannel(channelId) {
|
|
328
|
+
this.ensureConnected();
|
|
329
|
+
const channel = await this.client.community.channels.get({
|
|
330
|
+
id: channelId
|
|
331
|
+
});
|
|
332
|
+
return Converters.convertChannelToGeneric(channel);
|
|
93
333
|
}
|
|
94
|
-
getGuild(
|
|
334
|
+
async getGuild(_guildId) {
|
|
95
335
|
this.ensureConnected();
|
|
96
|
-
|
|
336
|
+
const community = await this.client.community.communities.get();
|
|
337
|
+
return Converters.convertGuildToGeneric(community);
|
|
97
338
|
}
|
|
98
339
|
convertMessage(rootMsg) {
|
|
99
|
-
return Converters.
|
|
340
|
+
return Converters.convertMessageToGeneric(rootMsg, this);
|
|
100
341
|
}
|
|
101
342
|
convertUser(rootUser) {
|
|
102
|
-
|
|
103
|
-
return Converters.toGenericUser(typedUser);
|
|
343
|
+
return Converters.convertUserToGeneric(rootUser);
|
|
104
344
|
}
|
|
105
345
|
convertChannel(rootChannel) {
|
|
106
|
-
|
|
107
|
-
return Converters.toGenericChannel(typedChannel);
|
|
346
|
+
return Converters.convertChannelToGeneric(rootChannel);
|
|
108
347
|
}
|
|
109
348
|
convertGuild(rootCommunity) {
|
|
110
|
-
|
|
111
|
-
return Converters.toGenericGuild(typedCommunity);
|
|
349
|
+
return Converters.convertGuildToGeneric(rootCommunity);
|
|
112
350
|
}
|
|
113
351
|
getClient() {
|
|
114
352
|
return this.client;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../../src/providers/root/provider.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,kCAAuC;AAGvC,yDAA2C;AAE3C,+CAI4B;AAO5B,MAAa,YAAa,SAAQ,mBAAY;IAM5C,YAAY,MAAkB;QAC5B,KAAK,CAAC,MAAM,CAAC,CAAC;QALR,W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,UAAU,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC;IACzD,CAAC;IAKD,SAAS;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF;AAhhBD,oCAghBC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/providers/root/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/providers/root/types.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAK5E,MAAM,WAAW,UAAW,SAAQ,cAAc;IAEhD,KAAK,EAAE,MAAM,CAAC;IAGd,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,aAAa,CAAC,EAAE,OAAO,CAAC;IAGxB,cAAc,CAAC,EAAE,MAAM,CAAC;IAGxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAG9B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAKD,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,QAAQ,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,WAAW,CAAC,EAAE,cAAc,EAAE,CAAC;IAC/B,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC;IACrB,SAAS,CAAC,EAAE,YAAY,EAAE,CAAC;IAC3B,OAAO,C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,MAAM;4BACP,MAAM;sBACZ,MAAM;;gCAEI,MAAM;uCACC,MAAM;6BAChB,MAAM,UAAU,MAAM;6BACtB,MAAM,aAAa,MAAM,SAAS,MAAM;gCAErC,MAAM,aAAa,MAAM,SAAS,MAAM;CAErE,CAAC;AAKF,eAAO,MAAM,iBAAiB,EAAE,oBAY/B,CAAC;AAKF,eAAO,MAAM,mBAAmB,EAAE,OAAO,CAAC,UAAU,CAOnD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/providers/root/types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/providers/root/types.ts"],"names":[],"mappings":";;;AAqMA,IAAY,aAqBX;AArBD,WAAY,aAAa;IACvB,gCAAe,CAAA;IACf,wCAAuB,CAAA;IACvB,gCAAe,CAAA;IACf,kDAAiC,CAAA;IACjC,kDAAiC,CAAA;IACjC,kDAAiC,CAAA;IACjC,kDAAiC,CAAA;IACjC,kDAAiC,CAAA;IACjC,kDAAiC,CAAA;IACjC,4CAA2B,CAAA;IAC3B,8CAA6B,CAAA;IAC7B,gDAA+B,CAAA;IAC/B,4CAA2B,CAAA;IAC3B,oDAAmC,CAAA;IACnC,8CAA6B,CAAA;IAC7B,oDAAmC,CAAA;IACnC,4CAA2B,CAAA;IAC3B,4CAA2B,CAAA;IAC3B,4CAA2B,CAAA;IAC3B,sDAAqC,CAAA;AACvC,CAAC,EArBW,aAAa,6BAAb,aAAa,QAqBxB;AAeY,QAAA,kBAAkB,GAAG;IAChC,WAAW,EAAE,CAAC,SAAiB,EAAE,EAAE,CAAC,aAAa,SAAS,WAAW;IACrE,UAAU,EAAE,CAAC,SAAiB,EAAE,SAAiB,EAAE,EAAE,CAAC,aAAa,SAAS,aAAa,SAAS,EAAE;IACpG,WAAW,EAAE,CAAC,SAAiB,EAAE,SAAiB,EAAE,EAAE,CAAC,aAAa,SAAS,aAAa,S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AE,IAAI;IACnB,cAAc,EAAE,IAAI;IACpB,oBAAoB,EAAE,CAAC;IACvB,KAAK,EAAE,KAAK;CACb,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "library.dr-conversion",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "Unified interface for building multi-platform chat bots (Discord, Root, and more)",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -56,14 +56,19 @@
|
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
+
"@rootsdk/server-bot": "^0.17.0",
|
|
59
60
|
"events": "^3.3.0"
|
|
60
61
|
},
|
|
61
62
|
"devDependencies": {
|
|
63
|
+
"@rootsdk/client-app": "^0.17.0",
|
|
64
|
+
"@rootsdk/client-app-ui": "^0.17.0",
|
|
65
|
+
"@rootsdk/dev-tools": "^0.17.0",
|
|
66
|
+
"@rootsdk/server-app": "^0.17.0",
|
|
67
|
+
"@types/jest": "^29.0.0",
|
|
62
68
|
"@types/node": "^20.0.0",
|
|
63
69
|
"@types/ws": "^8.5.10",
|
|
64
70
|
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
|
65
71
|
"@typescript-eslint/parser": "^6.0.0",
|
|
66
|
-
"@types/jest": "^29.0.0",
|
|
67
72
|
"discord.js": "^14.14.1",
|
|
68
73
|
"eslint": "^8.0.0",
|
|
69
74
|
"jest": "^29.0.0",
|