Giter Club home page Giter Club logo

kaztron's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

kaztron's Issues

spotlight: embed fields that are too long are truncated

  • Current behaviour by design: A field value in excess of 1024 characters, from a spotlight application, is truncated at 1024 characters (incl. an added ellipsis).
  • Maybe possible to just add more embed fields with the overflow text, instead of truncating?
  • Would need to limit this: max 25 fields, 6000 character limit (#4), may require multi-message overflow too
  • Limit also in case input data is unreasonable

spotlight application robustness - Discord ID field

User input is very iffy for Discord ID. Improve robustness:

  • Allow <@123456789012345678>, @123456789012345678, etc. - maybe look for a digits-only substring for maximum flexibility
  • Detect completely wrong data - is this handled adequately currently? Verify that nicknames, discriminators, etc. are rejected

Mute/ban management

  • Automatic tempban (mute) timing
  • Automatic detection of tempban (mute) evasion

`.notes group` - missing error/pseudo-error cases

  • .notes group rem - if user is not in a group, should give an error message, not 'ungrouped'
  • .notes group add - if two users are already grouped, should give an error message, not 'grouped'

Both operations are idempotent - functionally no change, purely a usability issue

Reconnect when websocket closed remotely (opcode=8, a.k.a. the random errorless disconnect problem)

[2018-02-11 16:11:18,241] (DEBUG) websockets.protocol: client << Frame(fin=True, opcode=8, data=b'\x03\xe8') [in /home/marcalexc/.virtualenvs/kaztron/lib/python3.6/site-packages/websockets/protocol.py:548]
[2018-02-11 16:11:18,241] (DEBUG) websockets.protocol: client >> Frame(fin=True, opcode=8, data=b'\x03\xe8') [in /home/marcalexc/.virtualenvs/kaztron/lib/python3.6/site-packages/websockets/protocol.py:564]
[2018-02-11 16:11:18,244] (INFO) kaztron.bootstrap: Closing event loop... [in /home/marcalexc/data/sw/KazTron/KazTron.py:64]
[2018-02-11 16:11:18,245] (INFO) kaztron.bootstrap: Exiting. [in /home/marcalexc/data/sw/KazTron/KazTron.py:66]

No notable traffic prior to this - normal message send/receives, user status changes, at least 60s prior to this.

Appears to be the remote server closing the websocket?

Spotlight: detect user not on server

Per discussion with Yazuki:

  • whenever changing or displaying the current spotlight app
  • Warn (as a separate message, to ctx.message.channel), if the selected user is not on the server

filter: allow removals by exact string match, not only index match

  • Challenges: intuitive command syntax?
  • On one hand, .filter rem <index or page> excludes numerical match (possible scenario: bot spam consistently uses a very identifiable string; could be dangerous because if allowed on add, a rem could accidentally hit another rule instead of the numerical match)
  • Other syntaxes like .filter rem index=x would disallow an index=x string, which is unlikely enough that this might be OK. However, it's unintuitive
  • Separate syntax like .filter rem vs. .filter rnum - unambiguous, but pollutes namespace, more commands to remember - slightly less user friendly?

"On Duty" role

From Grine_

2018-02-28 00:02:47

A bot-managed “On Duty” role, that can be used to notify active moderators without pinging atHere or atDiscordTeam. Mods could set themselves as on or off duty at will.

  • only role mgmt command, manually managed by mods

fix kaztron so it doesn't think .___. is a command and not a smiley

@Yazuki (屮゚Д゚)屮

2018-03-08 00:18:47

fix kaztron so it doesn't think .___. is a command and not a smiley

Possible solution: Assume anything that matches ^\.\W is not a command? Or anything not containing word characters at all (any emoticons that contain word chars but start with a period)?

Spotlight queue: start time stored in queue

  • Allow specifying and storing start time in spotlight queue - recordkeeping only, no automatic bot action based on date
  • queue ordering should become chronological by start time; breaking UX changes are OK

Reduce log verbosity

TBD which logger names to limit... mostly library dependencies e.g. websockets.protocol is horrendously verbose. We want to reduce this verbosity without losing out on debug logs from KazTron itself or other useful logs.

Rationale: 600MB log in 1 week

`.spotlight queue rem` - no help message

.spotlight [queue|q] <ctx>

[MOD ONLY] The `.spotlight queue` sub-command contains sub-sub-commands that let moderators
manage a queue of upcoming spotlights.

Commands:
  insert [MOD ONLY] Insert a spotlight application into the queue of upcoming...
  rem    
  next   [MOD ONLY] Set the next spotlight in the queue as the currently sele...
  list   [MOD ONLY] Lists the current queue of upcoming spotlights.
  add    [MOD ONLY] Add a spotlight application to the end of the queue of up...

Type .help command for more info on a command.
You can also type .help category for more info on a category.

Global command hook: logging incoming commands

  • Current situation: commands are logged by each command, manually - a lot of copy-pasted logging code
  • Enhancement: Create a global pre-command hook
  • May depend on Discord.py 1.0.0 (unreleased)? Mentioned as a new feature in the transition document

Bug - Possible to execute commands prior to on_ready running (all cogs) - DATA LOSS POSSIBLE

Several cogs are dependent on on_ready running prior to commands being available (loading data from servers, etc.)

A global or optional cog-level check to prevent commands being run before on_ready would avoid bugs due to this (including some destructive ones - e.g. if the bot hasn't loaded state.json configs and a command attempts to write to these structures, it can delete data)

May be related to the proposed refactors of #48

.wb random image can roll out of range

[2018-03-02 06:38:27,215] (DEBUG) kaztron.cog.modtools: wb: random image = 7 [in /kaztron-prod/KazTron/kaztron/cog/modtools.py:109]
[2018-03-02 06:38:27,215] (WARNING) kaztron.cog.modtools: wb: Invalid index: [2018-03-02 06:38:27] <#worldbuilding:Laogeobunny#4569> '.wb' [in /kaztron-prod/KazTron/kaztron/cog/modtools.py:114]

len(images) == 7, range should be 0-6 but here rolled 7

Voice features - various bugs

Various issues with voice features:

  • Fails to retrieve role (get_named_role call does not pass server)
  • Fails to identify transition from a listed to non-listed voice channel, and remove voice role

Refactor cogs to generalise config access

Currently, most cogs manually call get_kaztron_config() and store a reference in an attribute, as well as similar calls for the state.json config and any cog-specific config files. For the latter two, many of them also tend to have

Can this be generalised to reduce repetition?

  • Base class that loads and provides the config object attribute, as well as direct accessors of some sort for the cog-specific and general (core/discord) sections of the config files?
  • on_ready status/precondition on all commands? (pre-command hook - can it cancel command?)
  • Abstract base class with deserialise/serialise hooks to load/store data in config?

modnotes: ChanServ-like syntax

  • e.g. .notes @user alias add <alias> instead of .notes alias add @user <alias>
  • 1.4 major usability rework?
  • Determine scope: full changeover (training problems since 1.3 release is public)? Or add as an alternative (some possible disambiguation problem with 1.3 syntax)?
  • Custom parser required: effort vs benefit?

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.