antb / bugbot Goto Github PK
View Code? Open in Web Editor NEWA MafiaBot which mutated to provide a basic level framework.
A MafiaBot which mutated to provide a basic level framework.
This bot is originally created to run Mafia games on freenode. I seperated each section into modules because some other people wanted a lightweight bot they could do whatever they wanted to do with. I've spent more time on the framework building it up for these people instead of the mafia part of the bot itself. --- Run genconfig.py to set your configuration options. Run BugBot.py to load up your bot. --- Use genplugin.py to get a blank plugin file. I don't have command name conflict resolving yet, so try not to use a command already in use. The cmds class should contain all your commands as defines There is regular expression support for snarfing strings directly out of the chat, these are contained in the regexp class. The format of this is simple: def commandName(self,match): r'Regular Expression' doStuff() match will contain the result from an re.group(0) function. Usually the matching string. The only infrastructure I provide for you to use is outlined below. You will need to import any modules for anything else you need. self._parent. term -> Prints to the console -> term(LEVEL,'TEXT') -> Use FUNC, SUB, DBG and ERROR for the LEVEL, 'TEXT' should be obvious. send - Sends a message to IRC -> send('TEXT',nick=False,channel=False) -> 'TEXT' is what you want to send -> nick will be prepended to TEXT if given. You can use True to provide the callers nick -> Channel will default to the current channel unless you specify otherwise quote - Sends a raw irc command -> quote('TEXT') -> 'TEXT' is your command notice - sends an irc notice -> notice('TEXT','TARGET') -> 'TEXT' is the notice content -> 'TARGET' can be a person or a channel getNick getHost getUser getFullHost getChannel -> All return what you'd expect getMessage -> Returns everything after the command getArg(argNum) ->getArg(num) -> num is any integer, it'll return the word at the position after the message, starting at one command arg1 arg2 arg3 0 1 2 3
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.