Browse Source

Add Channel:getCount;

bjorn 1 year ago
parent
commit
461d226c09
2 changed files with 36 additions and 0 deletions
  1. 19 0
      api/init.lua
  2. 17 0
      api/lovr/thread/Channel/getCount.lua

+ 19 - 0
api/init.lua

@@ -42961,6 +42961,25 @@ return {
                 }
                 }
               }
               }
             },
             },
+            {
+              name = "getCount",
+              summary = "Get the number of messages in the Channel.",
+              description = "Returns the number of messages in the Channel.",
+              key = "Channel:getCount",
+              module = "lovr.thread",
+              variants = {
+                {
+                  arguments = {},
+                  returns = {
+                    {
+                      name = "count",
+                      type = "number",
+                      description = "The number of messages in the Channel."
+                    }
+                  }
+                }
+              }
+            },
             {
             {
               name = "hasRead",
               name = "hasRead",
               summary = "Get whether a message has been read.",
               summary = "Get whether a message has been read.",

+ 17 - 0
api/lovr/thread/Channel/getCount.lua

@@ -0,0 +1,17 @@
+return {
+  summary = 'Get the number of messages in the Channel.',
+  description = 'Returns the number of messages in the Channel.',
+  arguments = {},
+  returns = {
+    count = {
+      type = 'number',
+      description = 'The number of messages in the Channel.'
+    }
+  },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'count' }
+    }
+  }
+}