clam- / pyburlybot Goto Github PK
View Code? Open in Web Editor NEWIRC bort
IRC bort
Also maybe only actually create events if needed.
: is used to split serverlabel:#channel when using config command.
At the moment I'm raising error in this situation, but should we allow it and somehow work around?
Things like TopicEvent, KickEvent, NickEvent, and so on.
Doesn't make sense to crowd Event base with many thing like ".oldTopic" and ".newTopic"
Program should default to looking for "bbm.json" if no config file is specified on the command line, if the file doesn't exist, it should be created with defaults.
There also should be an option -c --create-config which will just create the file specified (or "bbm.json" if not specified), and exit.
.admins
Server
setting should probably be a property that converts the list to lower()
'd strings on set.
Then wrapper._isadmin
just needs to lower()
the event.nick
.
Add global 'currently reloading' mutex for when we're reloading modules for threads to acquire when calling module-provided functions from util.ADDONS. Minor, just to prevent weirdness, I doubt anything bad will happen from key lookup in the event that a module thread does a getattr on ADDONS while it's being modified.
The following need doing:
There's many others to do but these are the ones I want and then can start using in production.
I currently rewrote how sendmsg
and MSGHOOKS
works because I wanted to use sendmsg events in steamchat module, which made me realise that the current implementation was kind of bad. (The rewrite isn't commited/pushed yet.)
Deciding how Mapping.override
and MSGHOOKS
interact needs to be done before it can be implemented properly.
So the only sane use of sendmsg
at the moment is for capturing IRC bot outbound messages.
IRCCLient comes with a bunch I don't really like what they do...
Skeleton framework is there. Maybe some copy-paste from old bot will come in handy, hee hee.
Addons is not server aware at the moment. Dispatcher will _add
for a server that has it enabled/allowed, so to make this work properly Addons just needs a {network: {addonname : Addon]}
mapping, probably.
The call to getaddon
(or whatever) will then need to be given a network name, but you could throw it in to container as bot.getAddon()
which will internally call Addon.get(bot.networkname, )
etc...
Other than that, I think it might need a rethinking. Considering to things like how to die when an addon isn't available, and alternative actions/providers or something.
Also do we want to do things like where expecting list, allow string?
example:
altnicks = ["alt1", "alt2"]
and also allow:
altnicks = "alt1"
There are a couple of cases in the code where I have already allowed this kind of thing.
Normally datespec combined 2 "words" to form things like "on 3/3" or "in 4days", but we should probably check the first word for "tomorrow" then shuffle args around if that's the case.
More importantly are there any other one day relative times like that.
Context is "remind you tomorrow get ham"
Remember "remind you next week get ham" is 2 words.
For example in the googleapis.py
module, I've been returning results as tuples just containing the fields I've been needing to use in the actual modules that use those apis.
Should we actually be returning the JSON dictionaries in full? (probably. I've done it with youtube helper method.)
Not looking forward to this. For now I think unicode Google results are broken and long unicode messages will get truncated bad.
I set a reminder for two hours, and it was never delivered.
Other reminders set around the same time were delivered though.
SynIRC seems to have a trailing space after the last user in a RPL_NAMREPLY.
This will/does cause bad things to happen when parsing the line.
What to do? Should we strip first? How far will we go to cleanup malformed messages?
For example:
The variable for a "server name" is called "serverlabel" in settings, "network" in container, and probably 5 different things elsewhere.
I think this happens with a few other things, also.
pls help
holybutts, I do not feel like checking this.
So, the way we present URLs is usually (http://something.com)
We are lucky that mIRC is smart about what it considers part of a URL, but other things aren't as smart. Steam for example treats characters as part of the URL.
It appears Steam will follow "email" convention of enclosing URLs in chevrons <http://something.com>
. I think this was some old defined standard or "suggestion" somewhere but I don't remember where I read it.
What do?
Create a generic CHAT logging to file module.
Do we want to add "months" and "weeks" to util.helpers.distance_of_time_in_words
?
At the moment if someone does something like .remind me in 3months do stuff
it'll say:
I will remind you about that in 88 days, 14 hours and 12 minutes.
Do we want to add more coarse units?
Steps to Reproduce:
.remind me in 1.5days remindmessage
Expected Response:
<pyBurlyBot> <user>: I will remind you about that in 1 day and 12 hours.
Actual Response:
<pyBurlyBot> <user>: I will remind you about that in 1 day and 6 hours.
Please fix
This is a critical, blocking bug
From updaterelaunch.py:
#TODO: This won't really play nice when running multiple bot processes at a time.
# After the first bot process updates, the rest will think they are up-to-date.
# This could be solved by storing modtimes of modules and core files at launch time and comparing them.
Because of some type checking magics for module options, setOption could be slow.
This might be a problem if a module needs to setOption like every event.
I don't really want to add even more complexity to those already giant functions, but maybe we can bypass it with a typesafety=False or something.
dunno if this is possible.
Things like "missing { at start of document" would be good...
Like title says.
I guess need to query for undelivered items and count. Should be trivial.
Someone might want "help" available, but might not want "reload" available.
Also whatever is going to contain "reload" should probably be fleshed out with other commands like "join", "part", "quit" and maybe some things like "privmsg" and such...
Note that we can use the Google API to do spell checking:
google.py#L48
Should we? Google is pretty lenient about spelling errors.
Throttle on msg's so they turn into notices if it's sending too many to a certain channel at a time would be funky.
One wonders, but one must know.
I have a feeling server's added up to that point will be "updated" or new, and servers not added yet will not exist or be stale.
Need to know and also decide if that's desired behaviour.
Note to self, check pls
And by that I mean chaining the callback chain, since we are already using deferred by virtue of deferToThread
Minor performance tweak maybe would be to consider allowing the fetching of multiple options inside a bot.getOption
call.
Integer is spelled "Interger"
this makes me upset.
Do we want to have an attribute in the mapper called "adminonly=False/True" or whatever and check for admin ability before dispatch?
It would save the boilercode in modules "if bot.isAdmin()", but that's about it.
The other useful thing it would do is that on !help, we can limit display of adminonly commands (at the moment I'm just filtering the list to remove eval, just in case.)
It may also be useful for some kind of admin conditional regex or some other weird thing someone may want to do.
Gogo gadget Griff
Probably applies to normal core files, too.
What junks do you want at the top of the file.
For example, help strings.
Do we use ghetto italics?
How to handle encoding properly... I'm assuming raw sendlines aren't encoded, and just the message portions are. Is there a server that handles weird encoded nicknames? how are they handled in prefix?
At the moment I'm just encoding on the higher level functions like msg, and when generating nickname (that isn't to assume nicknames can be unicode, it's just because they are decoded to unicode from the config.)
Are there weirdly encoded channels? I wonder. This needs looking in to sometime...
We can't just jack "joined channel" event, because the bot may not be joining any channels.
The other option is to use callLater from the "signed on" event, but I wonder how long is appropriate to wait...
Do some simple write-through caching of aliases.
I think we need to make more helper methods :((((
Example:
(06:08:58) <@Clam> .gis computer
(06:08:59) <bbm> Personal computer - Wikipedia, the free encyclopedia (http://upload.wikimedia.org/wikipedia/commons/thumb/c/c1/Computer-aj_aj_ashton_01.svg/2000px-Computer-aj_aj_ashton_01.svg.png), HOW TO KEEP YOUR COMPUTER BLAZING FAST ? | KNOWEB BLOG (http://www.ittrainingnepal.com/img/image/_42_article_slc.jpg), Buffalo Computer Consulting (http://www.buffalocomputerconsulting.com/images/computer.jpg), What is a Desktop Computer? (with pictures) (http://images.wisegeek.com/blac
Allow for the following:
<User> .c 5 + 5
<pyBurlyBot> 5 + 5 = 10
<User> .c * 500
<pyBurlyBot> 10 * 500 = 5,000
Some quick thoughts:
See notes for some twisted things
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.