perrycate / cerebrum Goto Github PK
View Code? Open in Web Editor NEWA bot for the Dededediscord. Consider this a rough draft, don't expect high quality if you're reading through the code...
License: GNU General Public License v3.0
A bot for the Dededediscord. Consider this a rough draft, don't expect high quality if you're reading through the code...
License: GNU General Public License v3.0
Discord.py has a lot of useful features that I'm not taking advantage of yet: https://discordpy.readthedocs.io/en/latest/ext/commands/index.html
From a learning standpoint it makes sense for me to start small, but as(/if?) this project grows I'll eventually need to start taking full advantage of the library to avoid reinventing the wheel.
Maybe make it that discords have to be explicitly linked (via config file maybe) to share commands between them.
This includes !save and !delete, possibly others.
Server admins can then manage who has access to those commands based on who can see that channel.
ie !emote :some_emote: would respond with a message where the content is just that emote. I think.
Don't have to be super comprehensive, but we're at the point where I need to be able to make sure changes don't break everything without having to test manually in discord.
!save a-command
content is down here with no space after "a-command"
would currently be stored as something like "a-command\ncontent".
We just need to change from string.split(' ') to string.split()
Instead of saving a fixed response to a given trigger, users could save (and later add) multiple potential responses, from which one is selected every time that command is triggered.
Current thoughts:
"Maybe instead of having the command be !record, I'll make it !save and !add (or similar.) One to make it a single command, the other to add/create a random command. If someone tries to save a random command or add to a single command, it'll give an error."
Will probably need to include a mechanism for enumerating the currently saved responses, and removing some of them.
I'm not comfortable having people save commands until I'm confident that I won't accidentally nuke said commands at some point.
Newton would respond* in any channel to those with that role, not just the admin channel.
*Newton would need write permissions to that channel though, so mods still have a way to restrict things.
** Should only respond to ~commands, not !commands.
I don't really care about trying to explain that this code isn't useless, but I should at least make it clear how to get started for anyone interested in contributing.
Saved line breaks are converted to spaces instead of being kept as newlines. Use partition instead of split() when parsing input.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.