Skip to content

Commit

Permalink
Added ChatThrottleLib
Browse files Browse the repository at this point in the history
  • Loading branch information
Ketho committed Nov 27, 2024
1 parent 0deeb44 commit b6e2b95
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 3 deletions.
48 changes: 48 additions & 0 deletions Annotations/Libraries/ChatThrottleLib/ChatThrottleLib.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---@meta _

---@class ChatThrottleLib
---[Documentation](https://warcraft.wiki.gg/wiki/ChatThrottleLib)
ChatThrottleLib = {}

---@param prio string
---@param prefix string
---@param text string
---@param chattype string
---@param languageID? number
---@param destination? string
---@param queueName? string
---@param callbackFn? function
---@param callbackArg? any
---[Documentation](https://warcraft.wiki.gg/wiki/ChatThrottleLib#ChatThrottleLib:SendChatMessage)
function ChatThrottleLib:SendChatMessage(prio, prefix, text, chattype, languageID, destination, queueName, callbackFn, callbackArg) end

---@param prio string
---@param prefix string
---@param text string
---@param chattype string
---@param target? string
---@param queueName? string
---@param callbackFn? function
---@param callbackArg? any
---[Documentation](https://warcraft.wiki.gg/wiki/ChatThrottleLib#ChatThrottleLib:SendAddonMessage)
function ChatThrottleLib:SendAddonMessage(prio, prefix, text, chattype, target, queueName, callbackFn, callbackArg) end

---@param prio string
---@param prefix string
---@param text string
---@param chattype string
---@param target? string
---@param queueName? string
---@param callbackFn? function
---@param callbackArg? any
function ChatThrottleLib:SendAddonMessageLogged(prio, prefix, text, chattype, target, queueName, callbackFn, callbackArg) end

---@param prio string
---@param prefix string
---@param text string
---@param chattype string must be WHISPER
---@param gameAccountID number
---@param queueName? string
---@param callbackFn? function
---@param callbackArg? any
function ChatThrottleLib:BNSendGameData(prio, prefix, text, chattype, gameAccountID, queueName, callbackFn, callbackArg) end
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Change Log

## [0.17.8] - 2024-11-27
- Added ChatThrottleLib

## [0.17.7] - 2024-11-27
- Update annotations for patch 11.0.5, 4.4.1, 1.15.5

Expand Down Expand Up @@ -153,6 +156,7 @@ To avoid loading for Lua projects not related to World of Warcraft, all settings
- PR [#123](https://github.com/Ketho/vscode-wow-api/pull/123) Make childGroups optional in AceConfig.OptionsTable
- PR [#120](https://github.com/Ketho/vscode-wow-api/pull/120) Add definition for tostringall()

[0.17.8]: https://github.com/Ketho/vscode-wow-api/releases/tag/0.17.8
[0.17.7]: https://github.com/Ketho/vscode-wow-api/releases/tag/0.17.7
[0.17.6]: https://github.com/Ketho/vscode-wow-api/releases/tag/0.17.6
[0.17.5]: https://github.com/Ketho/vscode-wow-api/releases/tag/0.17.5
Expand Down
8 changes: 8 additions & 0 deletions LuaScripts/Tests/Libraries/ChatThrottleLib.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

ChatThrottleLib:SendChatMessage("NORMAL", "someprefix", "hello world", "SAY")
ChatThrottleLib:SendChatMessage("NORMAL", "someprefix", "some dwarfish", "SAY", 6)

ChatThrottleLib:SendAddonMessage("BULK", "someprefix", "hello world", "PARTY")
ChatThrottleLib:SendAddonMessageLogged("NORMAL", "someprefix", "hello world", "PARTY")

ChatThrottleLib:BNSendGameData("NORMAL", "someprefix", "hello world", "WHISPER", 123)
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ Shows completion for GlobalStrings at >3 uppercase letters to declutter fuzzy se

### Activation
This extension will only activate when either:
> - A proper [.toc](https://warcraft.wiki.gg/wiki/TOC_format) file exists when the workspace is opened.
> - The extension was previously loaded in the workspace.
> - The "Activate WoW API extension" command is used.
- A proper [.toc](https://warcraft.wiki.gg/wiki/TOC_format) file exists when the workspace is opened.
- The extension was previously loaded in the workspace.
- The "Activate WoW API extension" command is used.

![](img/readme/activate.png)

Expand Down

0 comments on commit b6e2b95

Please sign in to comment.