Niftybot-Discord v1.0.1 Release

Hey all,

We’ve released a new version of Niftybot-Discord that contains a few bug fixes.  Assuming you haven’t made any changes to the code, you should be able to pull the repository and restart the bot to make use of the bug fixes (this method may contain additional bug fixes not listed here, which you can view by viewing the latest commits).

If you aren’t keen on pulling, you can download the latest release and simply overwrite your files, since this won’t overwrite your database, bot configuration, or channel settings.

This release contains fixes for the following:

  • Fixed issue with botadmin command not stripping out characters correctly
  • Bad requirements file for installing with pip
  • Fixed issue with generating a bad config file for the server when using genconfig

There are still some pending issues, and once those are fixed, another patch release will be created.
As always, you can view the (incomplete) documentation here 

As the documentation is still so limited, if you need support or assistance, please use either the forums or our discord

Site Cleanup + SSL Issues

Hey all,

In an effort to clean up the site, I have removed multiple different areas, which includes:

  • The forums
  • Bug / feature tracking (all projects will now be tracked through their GitHub repositories as they are made public)
  • The wiki (everything will be done through github pages moving forward)

The support area and this blog will remain functioning, and a small forum may be added later (something light weight and small compared to SMF).


There are currently some ongoing SSL issues with the subdomains (i.e. https://niftybot.snoring.ninja) that I am working to get resolved with the web host.  Once they are resolved I will update this post.

Update, 9/14/2017 2:55Pm – SSL issue has been resolved

~ ninja

Commands Update: Require users to accept ToS before command use

Hello all,

As part of the previous blog entry, I detailed a few changes that would be coming to bring the bot into line with the Discord Developer Terms of Service.  One of these changes, which was the storage of data without user permission, was a relatively easy fix to implement.

With the latest round of pushes, the bot will no longer process any commands if the user is not added into the accepted_users table within the SQLite database.  If they try to use a command before accepting, the bot will currently post a message detailing that it logs data and that to use commands you must accept the terms of service.

Moving forward, this will continue to change, as I modify the method in which the bot notifies the user they need to accept. Ideally, it will do one of the following, configurable per server:

  • Post the message only in certain channel(s)
  • PM (with a post fall back if the bot is blocked or they block all private messages)
    • There will be no method of disabling this message, it has to display one way or another

In the near future I will implement the hashing / encrypting of information, even if the information is publicly available to anyone who knows how to enable developer mode (hint: it’s easy).

~ ninja

All About Configuration Files + Discord Developer ToS Changes

Hello all,

As part of the rewrite, I decided to implement per-server configuration files.  These config files allow server owners to enable, disable, and update different plugins for their server through a (mostly) simple command syntax from right within their server (there will never be a dashboard for Niftybot-Discord as I will not be hosting it publicly for large scale use).

What this means is that a few things had to happen:

  • When the bot is added to a server, the server owner can generate the default configuration file, which follows the naming structure of SERVER_ID.ini
  • Once generated, they can configure different aspects of the bot for their server (i.e. enabled welcome and leave messages and specify a channel for each)
    • The syntax would follow:
      • [prefix]config JoinPart welcome_channel_id CHANNEL_ID
      • [prefix]config JoinPart member_join_enabled True
  • The code behind the different cogs then has some logic to ensure the command / function is enabled, if it needs a specific channel it gets that ID, and then does what it needs to do

The configuration system is far from perfect as it sits, as a lot of cogs need hard-coded logic checks to ensure different settings are in the right format, as well as other things, but in the current state it does get the job done well enough.

Alongside the server specific config files, there is still the core bot configuration that handles the bot token, database name, etc. that cannot be updated from within discord and must be updated manually.


The second issue I wish to touch on is the changes to the Discord developer Terms of Service.  One of the major things that was changed is that to store any information now we must get the express permission of the users.  To combat this, I have implemented an “accept” cog.  If a user tries to use a command and has not yet accepted the bot Terms of Service (which states that it stores publicly available information for later use, among other things), they will get a message telling them they must accept.

Once they accept, they are added to a table in the SQLite database and every time they use a command it quickly checks that their discord ID exists in the that table and if so it continues forward running the cog like it normally would.

There is no way to “opt out” of this accept right now once a user has, but that will be coming shortly alongside some method of preventing users from adding and removing themselves to circumvent or cheat at something (i.e. Betting Game).

Another change to the discord developer ToS is the requirement to encrypt all data.  Although the userID, serverID, etc. are publicly available information (enabled developer mode and right click a user / server / channel and you can copy the ID), the new ToS states this data needs to be encrypted if stored.  What this means is that at some point in the future I will be implementing encrypted storage for userID and serverID, as well as anything else that needs to be stored (i.e. a GW2 API Key).

 

~ ninja

Database Change: SQLite

Hello all,

As part of the changes in this alpha rewrite, we decided to change the database structure.  Originally, the database class used MySQL (pymysql) to handle the database.  One of the things we wanted to allow was easy usage of the bot, which would have been complicated by using MySQL, which would have required some sort of actual database (hosted locally or remotely).

By swapping to sqlite, we can now ship the database with the bot.  This means that anyone can technically install Python3, grab the bot code, and run the bot (or in theory they will be able to once we write a proper setup script to generate the database + ini files).

~ ninja

Configuration File Changes

Hello all,

We’ve made some changes to the way we handle configuration files.  To begin, we are no longer using YAML as our format for configuration files.  While YAML was nice to begin with, it became a hassle and nuisance to deal with updating YAML files from within bot commands for different things.  As a result, we have swapped the file format back to the more common ini file format.

Secondly, we’ve moved away from having a single configuration file.  While this would be nice for a bot running in a single server, the idea behind the bot was to allow it to function in multiple servers at one time.  So while we still have the core configuration file that contains the required information for the bot to startup and connect, each server will now have their own configuration file.  We’re still ironing out the details of generating this file when the bot is added to another channel (i.e. who is considered the owner in that server), but once we get there we will be one step closer to public release.

~ ninja

Niftybot Discord – Upcoming Alpha Release

Hey there!

I am happy to announce that we are approaching the alpha release of Niftybot for Discord!  This bot is built on discord.py and is being designed for multiple server use and to come packaged with some helpful initial plugins (cogs).

The source code is currently not available, but it will be once the bot is officially released into an alpha state.  We will also include a link to a public discord where you can test plugins, get help, or provide support towards the bot.

We hope to see you on the discord and we hope you help us build Niftybot-Discord into something awesome!

~ ninja

Welcome!

Welcome to the Snoring Ninja blog!

This blog will handle announcements, etc. concerning anything that Snoring Ninja is working, including but not limited to Niftybot, a Twitch bot built in Python; SMF modifications for 2.0.x and the eventual 2.1.x release; and other projects we undertake!

We encourage you to visit and join the forums to interact with our community as well as with us outside of the blog!

Thanks, and see you soon,

~ ninja