Massive refactoring/-structuring

This commit is contained in:
mrhanky
2017-07-07 02:11:20 +02:00
parent a82175a44b
commit 59b67d9570
41 changed files with 202 additions and 1011 deletions

3
files/.env Normal file
View File

@ -0,0 +1,3 @@
DATABASE_URI=postgresql://<pgsql user>:<pgsql password>@<pgsql host>:<pgsql port>/<pgsql database>
GOOGLE_API_KEY=<google api key>
PASSWORD=<znc password>

39
files/config.json Normal file
View File

@ -0,0 +1,39 @@
{
"username": "nxy",
"host": "localhost",
"port": 6667,
"ssl": true,
"autojoins": ["#nxy-dev"],
"flood_burst": 1,
"flood_rate": 4,
"flood_rate_delay": 1,
"includes": [
"irc3.plugins.uptime",
"bot.plugins.admin",
"bot.plugins.coins",
"bot.plugins.ctcp",
"bot.plugins.isup",
"bot.plugins.linux",
"bot.plugins.mcmaniac",
"bot.plugins.quotes",
"bot.plugins.rape",
"bot.plugins.regex",
"bot.plugins.seen",
"bot.plugins.tell",
"bot.plugins.timer",
"bot.plugins.urban",
"bot.plugins.useless",
"bot.plugins.weather",
"bot.plugins.youtube"
],
"irc3.plugins.command": {
"guard": "irc3.plugins.command.mask_based_policy",
"cmd": "."
},
"irc3.plugins.command.masks": {
"mrhanky!mrhanky@cocaine-import.agency": "all_permissions",
"jkhsjdhjs!jkhsjdhjs@smoke.weed.everyday": "admin",
"sirx!sirx@n0xy.net": "admin",
"*": "view"
}
}

12
files/nxy-bot.service Normal file
View File

@ -0,0 +1,12 @@
[Unit]
Description=nxy python irc bot
After=network.target znc.service
[Service]
Type=simple
User=nxy
WorkingDirectory=/home/nxy/bot
ExecStart=/home/nxy/.virtualenvs/nxy/bin/python -m bot
[Install]
WantedBy=multi-user.target

BIN
files/old.db Normal file

Binary file not shown.

74
files/schema.sql Normal file
View File

@ -0,0 +1,74 @@
create table if not exists quotes (
id serial primary key,
nick varchar(30) not null,
item text not null,
channel varchar(32) not null,
created_by varchar(30) not null,
created_at timestamp not null default current_timestamp,
unique (nick, item)
);
create table if not exists mcmaniacs (
id serial primary key,
item text not null,
unique (item)
);
create table if not exists timers (
id serial primary key,
mask varchar(255) not null,
target varchar(32) not null,
message text not null,
delay varchar(10) not null,
ends_at timestamp not null,
created_at timestamp not null default current_timestamp
);
create table if not exists tells (
id serial primary key,
from_nick varchar(30) not null,
to_nick varchar(30) not null,
message text not null,
created_at timestamp not null default current_timestamp,
unique (to_nick, message)
);
create table if not exists seens (
id serial primary key,
nick varchar(30) not null,
host varchar(255) not null,
channel varchar(32) not null,
message text not null,
seen_at timestamp not null default current_timestamp,
unique (nick)
);
create table if not exists users (
id serial primary key,
nick varchar(30) not null,
husbando varchar(255) null,
waifu varchar(255) null,
fines integer default 0,
unique (nick)
);
create table if not exists kills (
id serial primary key,
item text not null,
unique (item)
);
create table if not exists yiffs (
id serial primary key,
item text not null,
unique (item)
);
create table if not exists last_messages (
id serial primary key,
nick varchar(30) not null,
host varchar(255) not null,
channel varchar(32) not null,
item text not null,
unique (nick, channel)
);