Code Monkey home page Code Monkey logo

sbot's Introduction

sbot

a discord bot

setup

set up an app at https://discord.com/developers/applications

pip3 install -r requirements.txt
cp config.yaml{.example,}
$EDITOR config.yaml
./sbot

code eval

make the nsjail directory a sibling of the sbot directory:

cd ..
git clone --recursive git://github.com/google/nsjail.git
cd nsjail
make

check if you are cgroup v2:

grep cgroup /proc/filesystems

cgroup v2

sudo mkdir /sys/fs/cgroup/NSJAIL
sudo chown -R $USER: /sys/fs/cgroup/{cgroup.procs,NSJAIL}
sudo chown -R $USER: /sys/fs/cgroup/NSJAIL/cgroup.*
echo "+memory +pids" > /sys/fs/cgroup/NSJAIL/cgroup.subtree_control

cgroup v1

if /sys/fs/cgroup/memory doesn't exist:

sudo mkdir /sys/fs/cgroup/{memory,pids}
sudo mount -t cgroup memory -o memory /sys/fs/cgroup/memory
sudo mount -t cgroup pids -o pids /sys/fs/cgroup/pids

set up NSJAIL memory/pids cgroups:

sudo mkdir /sys/fs/cgroup/{memory,pids}/NSJAIL
sudo chown -R $USER: /sys/fs/cgroup/{memory,pids}/NSJAIL

EVE price checker

download sqlite-latest.sqlite.bz2 from https://www.fuzzwork.co.uk/dump/

bunzip2 sqlite-latest.sqlite.bz2

edit config.yaml so that eve_db is the filepath of the sqlite file

sbot's People

Contributors

dividinglimits avatar franz-princip avatar frosty-nee avatar jeremiahy avatar joshuas3 avatar lbatalha avatar raylu avatar romeozulu avatar taylskid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

sbot's Issues

Chronicle Command

Lots of great shit happens, and pinning comments can rarely capture entire sagas, like Jellek's, for people to read and/or have context without constantly playing back old stories. So, I propose the introduction of a command, provisionally named !chronicle for this text.

Syntax

!chronicle @user_mention number &comment
  • The user is a mention of the user to be archived,
    • if user is @all, or @everyone, no messages are filtered, and the last N messages are grabbed and logged.
  • The number is the last X messages a user sent. This will prevent unrelated messages being in there, but comes at the cost of the caller having to count relevant messages.
  • The command is the rest of the arguments joined by spaces, it is then included in the proposed header (below)

Archiving format

I would suggest a rather raw, file-based archival for easy browsing on whatever host it ends up being on, with a following format:

# $user-YYYY-MM-DD.txt
Author: $user
Time: YYYY-MM-DD hh:mm (UTC)
Comment: $comment
--- 
$user: Now this is a story all about how
$user: My life for flipped - turned upside down
... 

Additionally to flat file storage, I would suggest the command trigger the generated archive file to be commited to a git repository, and the git repository being pushed to origin. This would mean that any story captured would be immediately available with a git host (like github)

Alternative command name

Just some I came up with:

  • !log
  • !capture
  • !saga

Open Problems

  • Should there be some sort of two-stage mechanism that would announce the cut-off message by that user and require conformation and logging it? This would prevent message counting but introduce spam to the channel and make it more awkward to use.
    • This could be solved if the cut-off messages are PMd to the user for adjustment before confirmation, but would mean additional development effort.
  • If going with the git commit feature, there should also be a !chronicle link command that reads origin and spits it out to discord.

!timer respond in channel that the timer was set in

!timer should send the reminder to the channel that it was set in, instead of consolidating everything to a single channel.

Current functionality causes reminders from all connected servers to be sent to the same place

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.