1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
//! Discord schema: bot-token cache, channel/guild/message identity,
//! per-channel sync cursors, and log entries.
//!
//! Used by `discord.rs` (the faculty CLI). Messages use the generic
//! `archive::*` schema for the common shape (author / content /
//! reply_to / kind_message); this module only owns the Discord-
//! specific attributes and kinds. Attachments go through the shared
//! `files` branch + `file_schema` — not duplicated here.
//!
//! ## Identity
//!
//! Entity ids are derived intrinsically from the external Discord
//! snowflake via the identity-only-fragment idiom:
//!
//! ```rust,ignore
//! let id_frag = entity! { _ @ discord::message_id: external_handle };
//! let message_id = id_frag.root().expect("rooted");
//! let full = entity! { ExclusiveId::force_ref(&message_id) @
//! metadata::tag: archive::kind_message,
//! archive::author: author_id,
//! archive::content: content_handle,
//! // ...
//! } + id_frag;
//! ```
//!
//! Re-ingesting the same external id collapses to the same entity,
//! so edits update the existing entity rather than spawning a new one.
use id_hex;
use LongString;
use ;
use *;
pub const DEFAULT_BRANCH: &str = "discord";
pub const DEFAULT_LOG_BRANCH: &str = "logs";