RoHook Configuration
Added more configuration to the webhook.
This commit is contained in:
parent
7b840098fa
commit
74b6d0d5d7
28
RoHook.lua
28
RoHook.lua
|
@ -18,26 +18,42 @@ local function rgbToDec(rgb)
|
||||||
return rgbTotal
|
return rgbTotal
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
local module = {}
|
local module = {}
|
||||||
|
|
||||||
module.webhookConfig = {
|
module.webhookConfig = {
|
||||||
webhookUrl = "",
|
webhookUrl = "https://canary.discordapp.com/api/webhooks/682537382519635974/VfS2r9dRsPW4Q-Ti4FPhnoeWY1KdeLeS6F4bTA2oqWzKrqqQQ2qII0UVJtouBnHml52P",
|
||||||
overrideUsername = false,
|
overrideUsername = false,
|
||||||
overrideAvatar = false,
|
overrideAvatar = false,
|
||||||
|
|
||||||
username = "",
|
username = nil,
|
||||||
avatar = "",
|
avatar = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
local function getUsername()
|
||||||
|
local config = module.webhookConfig
|
||||||
|
|
||||||
|
if(config.overrideUsername) then
|
||||||
|
return config.username
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function getAvatar()
|
||||||
|
local config = module.webhookConfig
|
||||||
|
|
||||||
|
if(config.overrideAvatar) then
|
||||||
|
return config.avatar
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function module.newMessage(message)
|
function module.newMessage(message)
|
||||||
message = message
|
message = message
|
||||||
|
|
||||||
local content = {
|
local content = {
|
||||||
content = message,
|
content = message,
|
||||||
embeds = {},
|
embeds = {},
|
||||||
avatar_url = "",
|
username = getUsername() or "",
|
||||||
username= "",
|
avatar_url = getAvatar() or "",
|
||||||
}
|
}
|
||||||
|
|
||||||
function content.setWebhookUsername(name)
|
function content.setWebhookUsername(name)
|
||||||
|
|
Reference in New Issue