Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jokler committed Jun 22, 2019
2 parents 237f6eb + a92e622 commit 3592c7b
Show file tree
Hide file tree
Showing 37 changed files with 3,693 additions and 1,466 deletions.
1,833 changes: 1,230 additions & 603 deletions Cargo.lock

Large diffs are not rendered by default.

50 changes: 21 additions & 29 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "frippy"
version = "0.4.0"
version = "0.5.0"
authors = ["Jokler <[email protected]>"]
repository = "https://github.com/Mavulp/frippy"
readme = "README.md"
Expand All @@ -16,48 +16,44 @@ doc = false
[features]
mysql = [
"diesel",
"diesel_infer_schema",
"diesel_migrations",
"dotenv",
"r2d2",
"r2d2-diesel"
]

[dependencies]
irc = "0.13.4"
log = "0.4.1"
time = "0.1.39"
humantime = "1.1.0"
rlua = "0.12.2"
reqwest = "0.8.5"
regex = "0.2.6"
lazy_static = "1.0.0"
serde = "1.0.27"
serde_json = "1.0.9"
chrono = "0.4.0"
irc = "0.13.6"
log = "0.4.5"
time = "0.1.40"
humantime = "1.1.1"
rlua = "0.14.2"
reqwest = "0.9.0"
regex = "1.0.5"
lazy_static = "1.1.0"
serde = "1.0.79"
serde_json = "1.0.27"
chrono = "0.4.6"
glob = "0.2.11"
failure = "0.1.1"
circular-queue = "0.2.0"
failure = "0.1.2"
htmlescape = "0.3.1"
antidote = "1.0.0"
log4rs = "0.8.0"

frippy_derive = { path = "frippy_derive" }
htmlescape = "0.3.1"
rand = "0.5.5"

[dependencies.unicode_names]
git = 'https://github.com/Jokler/unicode_names'
branch = 'update-to-latest-unicode'


[dependencies.diesel]
version = "1.1.1"
version = "1.3.3"
optional = true
features = ["mysql", "chrono"]

[dependencies.diesel_infer_schema]
version = "1.1.0"
optional = true
features = ["mysql"]

[dependencies.diesel_migrations]
version = "1.1.0"
version = "1.3.0"
optional = true
features = ["mysql"]

Expand All @@ -69,10 +65,6 @@ optional = true
version = "1.0.0"
optional = true

[dependencies.dotenv]
version = "0.11.0"
optional = true

[dependencies.clippy]
version = "*"
version = "0.0.212"
optional = true
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017 Mavulp
Copyright (c) 2018 Mavulp

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# frippy [![Build Status](https://travis-ci.org/Mavulp/frippy.svg?branch=master)](https://travis-ci.org/Mavulp/frippy)
Frippy is an IRC bot which is splits its functions into plugins.
Frippy is an IRC bot which is splits its functionality into plugins.
Currently it has plugins to:

* Send the names of emojis used
* Convert currencies with the help of [fixer.io](https://fixer.io/)
* Send the titles of HTML pages linked
* Get unicode information about characters
* Send the titles of HTML pages linked
* Create factoids with Lua support
* Send messages to offline users when they join again
* Store messages intended for offline users
* Automatically change nickname when it is available again

Check the config.toml file to get an idea of how to set the bot up.
3 changes: 2 additions & 1 deletion configs/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ encoding = "UTF-8"
channels = ["#frippy"]
umodes = "+B"
user_info = "IRC Bot"
version = "frippy v0.4.0"
version = "frippy v0.5.0"
source = "https://github.com/Mavulp/frippy"
#ping_time = 180
#ping_timeout = 10
Expand All @@ -25,6 +25,7 @@ source = "https://github.com/Mavulp/frippy"
#"#frippy" = ""

[options]
#prefix = "."
#disabled_plugins = "Url"
# If no database url is set a HashMap is used
#mysql_url = "mysql://user:password@address/db"
2 changes: 1 addition & 1 deletion frippy_derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ proc-macro = true
[dependencies]
syn = "0.12.13"
quote = "0.4.2"
failure = "0.1.1"
failure = "0.1.2"
1 change: 0 additions & 1 deletion frippy_derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ fn expand_plugin(ast: &syn::DeriveInput) -> quote::Tokens {
pub fn derive_error(data: TokenStream) -> TokenStream {
let ast = syn::parse(data).unwrap();
let tokens = expand_error(&ast);
// panic!("{}", tokens.to_string());
tokens.into()
}

Expand Down
15 changes: 15 additions & 0 deletions log.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Read https://docs.rs/log4rs/0.8.0/log4rs/file/index.html for more information on how to use this file
refresh_rate: 5 minutes

appenders:
stdout:
kind: console
encoder:
kind: pattern
pattern: "[{d:35}](({h({l})})) {t} - {m}{n}"

loggers:
frippy:
level: info
appenders:
- stdout
1 change: 1 addition & 0 deletions migrations/2018-05-13-150818_create_events/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE events
8 changes: 8 additions & 0 deletions migrations/2018-05-13-150818_create_events/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CREATE TABLE events (
id SERIAL PRIMARY KEY,
receiver VARCHAR(32) NOT NULL,
content TEXT NOT NULL,
author VARCHAR(32) NOT NULL,
time TIMESTAMP NOT NULL,
`repeat` BIGINT UNSIGNED NULL
)
1 change: 1 addition & 0 deletions migrations/2018-09-19-231843_create_quotes/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE quotes
9 changes: 9 additions & 0 deletions migrations/2018-09-19-231843_create_quotes/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CREATE TABLE quotes (
quotee VARCHAR(32) NOT NULL,
channel VARCHAR(32) NOT NULL,
idx INTEGER NOT NULL,
content TEXT NOT NULL,
author VARCHAR(32) NOT NULL,
created TIMESTAMP NOT NULL,
PRIMARY KEY (quotee, channel, idx)
)
23 changes: 18 additions & 5 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

use failure::Fail;

pub fn log_error(e: FrippyError) {
let text = e.causes()
pub fn log_error(e: &FrippyError) {
let text = e
.causes()
.skip(1)
.fold(format!("{}", e), |acc, err| format!("{}: {}", acc, err));
error!("{}", text);
Expand All @@ -17,6 +18,10 @@ pub enum ErrorKind {
#[fail(display = "A connection error occured")]
Connection,

/// Thread spawn error
#[fail(display = "Failed to spawn thread")]
ThreadSpawn,

/// A Url error
#[fail(display = "A Url error has occured")]
Url,
Expand All @@ -25,7 +30,15 @@ pub enum ErrorKind {
#[fail(display = "A Tell error has occured")]
Tell,

/// A Factoids error
#[fail(display = "A Factoids error has occured")]
Factoids,
/// A Factoid error
#[fail(display = "A Factoid error has occured")]
Factoid,

/// A Quote error
#[fail(display = "A Quote error has occured")]
Quote,

/// A Remind error
#[fail(display = "A Remind error has occured")]
Remind,
}
Loading

0 comments on commit 3592c7b

Please sign in to comment.