Einige Upstream-Ändderungen

This commit is contained in:
Andreas Bielawski 2016-07-25 13:47:39 +02:00
commit dd893d220b
5 changed files with 45 additions and 19 deletions

0
.editorconfig Normal file → Executable file
View File

5
.gitignore vendored Normal file → Executable file
View File

@ -1,3 +1,8 @@
<<<<<<< HEAD
config.lua config.lua
=======
otouto/plugins/mokubot*
otouto/plugins/oubot*
>>>>>>> upstream/master
*.db *.db
tg tg

39
config.lua Normal file
View File

@ -0,0 +1,39 @@
return {
-- Your authorization token from the botfather.
bot_api_key = '235106290:AAGnHNheMSMkfuXt6r_hQ2hWZkCL3gHlCmw',
-- Your Telegram ID.
admin = 36623702,
-- Two-letter language code.
lang = 'de',
-- The channel, group, or user to send error reports to.
-- If this is not set, errors will be printed to the console.
log_chat = nil,
-- The port used to communicate with tg for administration.lua.
-- If you change this, make sure you also modify launch-tg.sh.
cli_port = 4567,
-- The block of text returned by /start.
about_text = [[
*Willkommen beim Brawlbot!*
Sende /hilfe, um zu starten
]],
-- The symbol that starts a command. Usually noted as '/' in documentation.
cmd_pat = '/',
-- false = only whitelisted users can use inline querys
-- NOTE that it doesn't matter, if the chat is whitelisted! The USER must be whitelisted!
enable_inline_for_everyone = true,
errors = { -- Generic error messages used in various plugins.
generic = 'Ein unbekannter Fehler ist aufgetreten, bitte [melde diesen Bug](https://github.com/Brawl345/Brawlbot-v2/issues).',
connection = 'Verbindungsfehler.',
quotaexceeded = 'API-Quota aufgebraucht.',
results = 'Keine Ergebnisse gefunden.',
sudo = 'Du bist kein Superuser. Dieser Vorfall wird gemeldet!',
argument = 'Invalides Argument.',
syntax = 'Invalide Syntax.',
chatter_connection = 'Ich möchte gerade nicht reden',
chatter_response = 'Ich weiß nicht, was ich darauf antworten soll.'
}
}

View File

@ -31,21 +31,6 @@ function bot:init(config) -- The function run when the bot is started or reloade
if not self.database then if not self.database then
self.database = utilities.load_data(self.info.username..'.db') self.database = utilities.load_data(self.info.username..'.db')
end end
-- MIGRATION CODE 2.0 -> 2.1
if self.database.users and self.database.version ~= '2.1' then
self.database.userdata = {}
for id, user in pairs(self.database.users) do
self.database.userdata[id] = {}
self.database.userdata[id].nickname = user.nickname
self.database.userdata[id].lastfm = user.lastfm
user.nickname = nil
user.lastfm = nil
user.id_str = nil
user.name = nil
end
end
-- END MIGRATION CODE
-- Table to cache user info (usernames, IDs, etc). -- Table to cache user info (usernames, IDs, etc).
self.database.users = self.database.users or {} self.database.users = self.database.users or {}

View File

@ -12,7 +12,6 @@ function help:init(config)
end end
function help:action(msg, config) function help:action(msg, config)
local commandlist = {} local commandlist = {}
help_text = '*Verfügbare Befehle:*\n'..config.cmd_pat help_text = '*Verfügbare Befehle:*\n'..config.cmd_pat
@ -20,11 +19,10 @@ function help:action(msg, config)
if plugin.command then if plugin.command then
table.insert(commandlist, plugin.command) table.insert(commandlist, plugin.command)
--help_text = help_text .. '\n• '..config.cmd_pat .. plugin.command:gsub('%[', '\\[')
end end
end end
table.insert(commandlist, 'hilfe [Plugin]') table.insert(commandlist, 'hilfe [Befehl]')
table.sort(commandlist) table.sort(commandlist)
help_text = help_text .. table.concat(commandlist, '\n'..config.cmd_pat) .. '\nParameter: <benötigt> [optional]' help_text = help_text .. table.concat(commandlist, '\n'..config.cmd_pat) .. '\nParameter: <benötigt> [optional]'
@ -52,7 +50,6 @@ function help:action(msg, config)
end end
utilities.send_reply(self, msg, 'Für diesen Befehl gibt es keine Hilfe.') utilities.send_reply(self, msg, 'Für diesen Befehl gibt es keine Hilfe.')
end end
return help return help