« first day (1 day earlier)      last day (482 days later) » 

6:53 AM
@overactor So I was thinking, I believe it's a better idea if we pass a Chatbot instance to the MetaModules instead of using a Settings class because I had in mind that Chatbot would also have some helper methods, like ban and unban.
lol, I say something and suddenly @ArtOfCode appears :D
 
@ProgramFOX just doing my morning check in :) it's 07:54 here
 
here it's 08:54
 
You're somewhere in Europe?
 
yep
 
Anyway, off to school once again now
 
6:57 AM
cya!
 
@ProgramFOX I had been thinking of something like that too
So, do we add an argument to the constructors of MetaModule and Module?
 
Yeah, that's what I was thinking about.
 
Chatbot should probably also contain get_cmd_lst() and get_help(cmd) functions
 
Good idea.
 
@ProgramFOX You're Belgian right?
 
7:00 AM
Indeed.
 
That way we can put the help and listcommands commands in modules too
that way people can change swap them for their own easily
@ProgramFOX Same here
 
I pushed a commit to remove Settings and use a Chatbot instance.
 
Ok, I pulled it
Bot started.
Well, it still runs without errors
>>stop
 
yeah, because we don't use the new classes anywhere
@overactor The bot ignores commands from the bot itself, run $-stop on the console.
 
@ProgramFOX I ran $+stop :]]
 
7:10 AM
That works too; stop is the only command where that doesn't make a difference.
 
makes sense
wait, does it?
 
No, it's a bug, but I haven't found a clean way to fix it yet.
 
does the bot say something if you shut it down from in chat?
hmm
 
it does
 
not very important
 
7:11 AM
> Bot terminated.
 
I'll have a look at the new constructors
oh wait, no
this can't work
 
Why not? Inside the Chatbot class, where we load the modules, we pass self to the MetaModule.
 
Since we're having people create instances of the modules in the Module files
We'll need to do it with a set_bot(self, bot) function
and call that in load_module
 
oh, indeed
 
no
darn it
The modules load recursively in the constructor
We could just make set_bot(self, bot) recurse too I guess
 
7:19 AM
Or we can just store a list of file names in the MetaModuleTemplate.py file and then read those in Chatbot.py and call load_modules with the file names while passing self as argument to set the bot instance.
 
@ProgramFOX That's another way
A list of dictionaries for Command then?
That would make load_module() more complicated though
 
@overactor Inside the Chatbot class?
 
since it now has to work differently for Modules and MetaModules
@ProgramFOX oops, I meant ModuleTemplate.py
 
Why would it be necessary to store a dictionary of commands there? We can get the command list from the (Meta)Modules and we also can execute the commands there.
 
I'm being stupid, it can still be a List of Command instances
I mean in the Module files
 
7:25 AM
Yes, in the Module files we can use a list/dictionary with Command instances to use in the execute method.
 
The problem is that load_module() now has to check if it's loading a Module or a MetaModule then
Though That's not so bad I guess
in MateModuleTemplate files, we could call the array modules
and in ModuleTemplate files, we could call it commands
then check which of the two is present in the file and call the appropriate constructor
 
yep, that should work
 
Or, we could merge ModuleTemplate and MetaModuleTemplate into one and allow a Module to contain both commands AND modules.
 
That would make it a bit more complicated though.
 
I guess the strict distinction wouldn't isn't bad
Ok, I'll adapt things to what we agreed to
 
7:36 AM
I just pushed a new commit so Command distinguishes between privileged and owner-only commands.
 
@ProgramFOX ok
I'm working on the rest
 
7:56 AM
@ProgramFOX there we go
 
nice!
btw you still have to fix your commit email, it seems
 
where does it say that?
 
Ok, I fixed it now I think
thanks for the heads up
 
8:05 AM
should we link some commits to Issue #8 - refactoring?
 
Good idea; you can automatically do that by putting "#8" anywhere in your commit message.
 
ah, i didn't know that
 
So, I suppose Chatbot.py will load all (Meta)Modules from a MetaModules.py file which is in the same format as MetaModulesTemplate.py.
 
@ProgramFOX MetaModules.py might be a confusing name though, since they don't necessarily need to be MetaModules.
@ProgramFOX but yeah
 
ModuleCollection.py?
 
8:10 AM
@ProgramFOX ModuleManifest.py?
ModuleList.py?
 
@overactor Sounds good.
 
you decide
So Chatbot has a MetaModule object and in init we do:
self modules = MetaModule('ModuleManifest', self)
?
 
yep
 
That's...
surprisingly easy
Do you want to work on that and the command() function
or do you want to put the commands into their own modules?
Or do you think we could safely work on Chatbot.py at the same time?
 
The standard commands should go to their own module, then people can disable them if they want.
 
8:16 AM
Exactly
or swap them out for their own
If they want a nicer looking list of commands for instance
 
"swap them out for their own"?
 
You know what, the cmd_list should return the full objects, not just the names
@ProgramFOX Well, they might want to plug in their own standard commands
with the same name as your standard commands but different functionality
 
Ah, yup, we haven't thought about collisions yet.
 
@ProgramFOX I was thinking about checking for collisions after loading them into Chatbot
and then either logging a warning or raising an error
 
Bot started.
 
8:20 AM
>>alive
 
@ProgramFOX Yes, I'm alive.
 
Alright, ModuleManifest is there (currently with an empty list) and Chatbot.py loads it, no errors so far.
 
>>lol
 
@ArtOfCode Command not found.
 
>>stop
 
8:21 AM
@ProgramFOX Bot terminated.
 
>>xkcd 948
nice
Oh, I know something I could work on
putting modules into subfolders
 
Not too hard, people just have to put an __init__.py in that subfolder and then they can be loaded like any other module.
 
oh can you just do import FileName.py then?
no need for from?
 
@overactor Yeah, then you can just do import subfolder.filename
 
@ProgramFOX is that required?
 
8:25 AM
The "subfolder." part? Yes. I believe you can do __import__ with a slash, though, but I'm not sure, will have to test.
Umm... apparently not.
But you can do it with the dot.
 
user153821
Bot started.
 
So in ModuleManifest.py, they'll have to put a dot.
 
KarmaBot returns :)
>>points get ProgramFOX
 
user153821
@ArtOfCode 200
 
>>points get overactor
 
8:26 AM
>> points give ProgramFox 100
 
user153821
@ArtOfCode 208
 
user153821
@overactor Changed points for ProgramFox by 100. New total: 300
 
>>points get
 
user153821
@ArtOfCode 721
 
>>points get
 
8:26 AM
>>points get
 
user153821
@ProgramFOX 200
 
user153821
@overactor 108
 
poor girl
 
@ArtOfCode You'll have to fix case-sensitivity :P
 
working so hard
 
8:27 AM
@ProgramFOX I debated that, but it's possible to have the same username for two different people, with one in lowercase
If someone screws up I can points admin to correct it
>>points admin ProgramFOX 100
 
user153821
@ArtOfCode Changed points for ProgramFOX by 100. New total: 300
 
@ProgramFOX So can we do it with no changes to the code then?
 
Oh, and in MetaModulesTemplate.py and ModuleManifest the filenames cannot contain .py because that will screw up the import.
 
>>points get
 
user153821
@ArtOfCode 721
 
8:28 AM
@ArtOfCode You can also have the same username with the same capitalization.
@overactor I believe so.
 
@ProgramFOX I noticed too
 
@ProgramFOX I'm hoping that will be rare enough that I don't need to worry about it
It'll just end up with two people sharing points
I could do it with IDs I suppose, but that's more effort ;)
 
@ArtOfCode Having two different users with different capitalization is very rare too, and it happens a lot that people get my capitalization wrong so case-insensitivity looks like a good idea.
 
I'll take a look at doing it. What's the Python .toLower() equivalent?
>>points get overactor
 
user153821
@ArtOfCode 108
 
8:30 AM
.lower()
 
>>points admin overactor 92
 
user153821
@ArtOfCode Changed points for overactor by 92. New total: 200
 
I pushed 2 minot commits
 
>>points admin ProgramFOX
 
user153821
@ArtOfCode Not enough arguments.
 
8:31 AM
>>points get ProgramFOX
 
user153821
@ArtOfCode 300
 
that's what I meant
 
One where I changed cmd_list() to return full objects and one where I made a comments clearer that states you don't need the .py in module names
 
@overactor not appearing for me
oh now they do
 
@ProgramFOX Hadn't typed my password yet ^-^'
Is my email correct now?
 
8:32 AM
ah :P
@overactor it is
I'm working on moving the built-ins to a module, but I have to go for ~1 hour, cya!
 
@ProgramFOX see you then
@ArtOfCode, so, how are the bot things?
 
@overactor Pretty good :)
Can't buy stars yet, but the rest works
 
@ProgramFOX we should probably rename ModuleManifest.py to ModuleManifestTemplate.py
@ArtOfCode Is there an API for it though?
 
@overactor There's an unofficial API
I.e. there's a URL i can go to to add a star
 
so you just send a request to that url and presto?
 
8:39 AM
In theory, yes
 
in theory, practice and theory are the same
 
But points can now be transferred
You are theoretically correct.
I haven't got daily awards, but I might just end up doing those manually because it's easier to manage
 
>>points get
 
user153821
@overactor 200
 
>>points get
 
user153821
8:40 AM
@ArtOfCode 721
 
@overactor and behold! it saves!
>>stop
 
user153821
@ArtOfCode Bot terminated.
 
@ArtOfCode How are you saving points by the way?
in a file?
 
Yeah, pickled
 
user153821
Bot started.
 
8:41 AM
Ziz did that bit
>>points get
...
>>points get ArtOfCode
 
user153821
Bot started.
 
>>points get
 
user153821
@ArtOfCode 721
 
@ArtOfCode @ProgramFOX I was thinking we could perhaps implement a model system to use databases like Django has
But that would be quite difficult
maybe there's a library we could use...
 
@overactor I'm OK with that as long as it's not me coding it :)
 
8:43 AM
@ArtOfCode heh
 
>>points give overactor 722
 
user153821
@ArtOfCode You do not have enough points to give that many away.
 
>>points give overactor 29
 
user153821
@ArtOfCode Changed points for overactor by 29. New total: 229
 
>>points blurt ArtIfCode 12
 
8:43 AM
...
yes?
 
>>points giev ArtOfCode 12
No message for typos?
 
It just doesn't recognise them
I suppose I could add 'command not found'
 
@ArtOfCode yeah
 
>>stop
 
user153821
@ArtOfCode Bot terminated.
 
@overactor yeah, that's what I was going off
 
user153821
Bot started.
 
Does ChatExchange not ahve a wrapper for it?
 
Probably, but I haven't investigated CE or how to use it
 
9:11 AM
>>points get
 
user153821
@ArtOfCode 692
 
you can call message.star() to star a message
 
where message == ?
 
a Message object I would assume
 
so I need to instantiate a message object with the id?
new Message(273927) or similar?
 
9:19 AM
client.get_message(273927)
where client is a Client object
 
and I get the client object from..?
>>points give overactor 3
 
user153821
@ArtOfCode Changed points for overactor by 3. New total: 232
 
@overactor So I can access it by using Chatbot.client?
 
I think you'll need an instance of chatbot
I'm not sure how you get it as it is, but in the next version, you'll get a reference when your module get created
which reminds me:
@ProgramFOX Command objects also need a reference to Chatbot
 
9:37 AM
>>stop
 
user153821
@ArtOfCode Bot terminated.
 
user153821
Bot started.
 
Let's see if this works...
>>points star 22493376
SUCCESS
Can it undo it?
>>points star 22493376
no
oh well
 
@ArtOfCode you can do message.star(False)
 
@overactor Yeah it's just working out when to do that
I could make an object containing starred message IDs
 
9:43 AM
I would make the command '>>star <message_id>' though
don't bother with the '>>points ' there
 
>>points get
 
user153821
@ArtOfCode 489
 
and '>>unstar <message_id>' to unstar
 
I could, but it's controlled by the points system, and otherwise it's just another command
 
And you can only unstar if you're the one who starred it
 
9:44 AM
Or unstarring also has a cost
 
you don't have to group all commands that relate to one system in one command though...
@ArtOfCode What if you star the wrong message by accident?
 
True, but that's hard to do accidentally
I can always refund points
 
>>points star 22493383
 
>>points get overactor
 
user153821
@ArtOfCode 132
 
9:47 AM
How much does it cost at the moment?
 
@overactor Yeah, that came to my mind too when I was away.
 
100 to star, 500 to pin
except pins won't work right now
because it's not room owner
 
>>unstar could just try to unstar the last message you starred
 
user153821
@overactor Command not found.
 
And I can't make it RO because it doesn't have 100 rep
 
9:49 AM
And refund your points
 
@overactor I don't think so. The ModuleManifest is, contrarily to the Config, always reused when someone clones the bot. Making it a template only would be more pain for the people who just want to run a local clone.
 
@ProgramFOX Point taken
You might want to move the shadow den stuff to a seperate repository
 
Need 7 upvotes on KB's posts to get to 100
I'll post a few
 
yeah, I'll certainly do that -- that will go to a separate module
 
@ArtOfCode You'll have to post actually good posts though
And you can't vote on them
@ProgramFOX just module or repository too?
 
9:52 AM
@overactor Both.
 
ok
 
no need to bloat the original repo
 
What modules will there be in the standard stuff?
 
But how will you group them
I can see an xkcd module
a random module
a admin module
 
9:55 AM
The similar commands will be grouped together.
 
a basics module
a translate module
 
So, we'll have: xkcd, random, admin, translate, and utils.
 
That seems about right
maybe time too
Bot started.
Wed Jul 1 09:59:16 2015
 
There's only one time command though -- I thought it would make sense to put it in the utils.
 
I gotta go for lunch
 

« first day (1 day earlier)      last day (482 days later) »