Fixed importing config from config.lua
This commit is contained in:
parent
6fa9ac3d2b
commit
bd1f647825
|
@ -7,18 +7,21 @@
|
|||
-- for the bot can be set. --
|
||||
-------------------------------------------------
|
||||
|
||||
local config = {}
|
||||
-------------------------
|
||||
-- GENERAL CONFIGURATION
|
||||
-------------------------
|
||||
|
||||
-- Bot username
|
||||
-- DEFAULT VALUE: "MumbleDJ"
|
||||
BOT_USERNAME = "MumbleDJ"
|
||||
config.BOT_USERNAME = "MumbleDJ"
|
||||
|
||||
-- Default channel
|
||||
-- DEFAULT VALUE: "Bot Testing"
|
||||
DEFAULT_CHANNEL = "Bot Testing"
|
||||
config.DEFAULT_CHANNEL = "Bot Testing"
|
||||
|
||||
-- Command prefix
|
||||
-- DEFAULT VALUE: "!"
|
||||
COMMAND_PREFIX = "!"
|
||||
config.COMMAND_PREFIX = "!"
|
||||
|
||||
return config
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
-- By Matthieu Grieger --
|
||||
-------------------------
|
||||
|
||||
local config = require("config")
|
||||
require "song_queue"
|
||||
|
||||
function piepan.onConnect()
|
||||
print("MumbleDJ has connected to the server!")
|
||||
local user = piepan.users["MumbleDJ"]
|
||||
|
@ -14,12 +17,13 @@ function piepan.onMessage(message)
|
|||
if message.user == nil then
|
||||
return
|
||||
end
|
||||
|
||||
local patterns = {
|
||||
"https?://www%.youtube%.com/watch%?v=([%d%a_%-]+)",
|
||||
"https?://youtube%.com/watch%?v=([%d%a_%-]+)",
|
||||
"https?://youtu.be/([%d%a_%-]+)",
|
||||
"https?://youtube.com/v/([%d%a_%-]+)",
|
||||
"https?://www.youtube.com/v/([%d%a_%-]+)"
|
||||
}
|
||||
print(string.sub(message.text, 0, 1))
|
||||
if string.sub(message.text, 0, 1) == config.COMMAND_PREFIX then
|
||||
parseCommand(message)
|
||||
print("Command has been found!")
|
||||
end
|
||||
end
|
||||
|
||||
function parseCommand(message)
|
||||
return
|
||||
end
|
||||
|
|
Reference in a new issue