Fixed importing config from config.lua

pull/18/head
Matthieu Grieger 2014-09-14 19:18:32 -07:00
parent 6fa9ac3d2b
commit bd1f647825
2 changed files with 18 additions and 11 deletions

View File

@ -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

View File

@ -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