You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25Lines changed: 25 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,6 +46,31 @@ Feedr requires Bun in order to work
46
46
2. Fill out all the required values in `.env.example` and rename it to `.env` once done
47
47
3. To run in developer mode, just run `bun --watch . --dev`, otherwise `bun run .`
48
48
49
+
## Design Rules
50
+
51
+
These rules are what to follow when working and developing on Feedr. There aren't a lot, but important for error handling.
52
+
53
+
### Database Function Return Guidelines
54
+
55
+
Each database function should **always** return a success indicator (`true`/`false`) along with associated data. To avoid confusion, here are the expected return types:
56
+
57
+
-**Success with data:**`true` should always return populated data, even if the data is not used. For example:
// Check if the channel is already being tracked in the guild
372
-
if(trackedChannels.length){
374
+
console.log(trackedChannels);
375
+
if(trackedChannels){
373
376
awaitinteraction.reply({
374
377
flags: MessageFlags.Ephemeral,
375
378
content: `This channel is already being tracked in ${trackedChannels.map((channel,index)=>`${index>0&&index===trackedChannels.length-1 ? "and " : ""}<#${channel.guild_channel_id}>`).join(", ")}!`,
0 commit comments