-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ad3ed56
commit 1155380
Showing
4 changed files
with
79 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,63 @@ | ||
IRC-BOT | ||
============= | ||
A basic IRC Bot built in PHP (using sockets) with wonderful OOP. | ||
# PHP BOT 404 | ||
A IRC Bot built in PHP (using sockets) with OOP. | ||
Designed to run off a local LAMP, WAMP, or MAMP stack. | ||
With a custom [Upstart](http://upstart.ubuntu.com/) script to run as Linux daemon. | ||
|
||
Web | ||
------- | ||
* [Our Official Website](http://wildphp.com) | ||
* [The Source Code](https://github.com/pogosheep/IRC-Bot) | ||
## Web | ||
* [Source] (https://github.com/matejvelikonja/IRC-Bot-404) | ||
|
||
Collaborators | ||
------- | ||
* [Super3](http://super3.org) - Frontend | ||
* [Pogosheep](https://plus.google.com/108868126361135455230/about) - Backend | ||
## Features and Functions | ||
|
||
### Commands | ||
|
||
* !weather [location] - Returns weather data for location | ||
* !joke - Returns random joke. Fetched from [ICNDb.com](http://www.icndb.com/). | ||
* !ip - Returns IP of a user. | ||
|
||
Features and Functions | ||
------- | ||
* !say [#channel] [message] - Says message in the specified IRC channel. | ||
* !say [username] [message] - Says message in the specified IRC user. | ||
* !poke [#channel] [username] - Pokes the specified IRC user. | ||
* !join [#channel] - Joins the specified channel. | ||
* !part [#channel] - Parts the specified channel. | ||
* !timeout [seconds] - Bot leaves for the specified number of seconds. | ||
* !restart - Quits and restarts the script. | ||
* !quit - Quits and stops the script. | ||
|
||
Install and Run | ||
------- | ||
1. Place the IRC-Bot folder in your server directory or htdocs. | ||
2. Create or edit a config file with your details | ||
(layne_bot.php and wild_bot.php are two working examples). | ||
3. Open your config file in your browser, or a command line. | ||
4. The bot will run as long as the command line or browser is open. | ||
5. Have fun! | ||
|
||
Sample Usage and Output | ||
------- | ||
<random-user> !say #wildphp hello there | ||
<wildphp-bot> hello there | ||
<random-user> !poke #wildphp random-user | ||
* wildphp-bot pokes random-user | ||
* !quit - Quits and stops the script. | ||
|
||
### Listeners | ||
|
||
Implements listener, that listen to changes in channels. | ||
|
||
* Joins - greets users when they join the channel. | ||
|
||
## Install | ||
|
||
### Config | ||
|
||
Copy configuration file and customize its content. | ||
|
||
cp config.php config.local.php | ||
|
||
Copy Upstart script to folder and make appropriate changes. | ||
|
||
sudo cp bin/phpbot404.conf /etc/init/ | ||
|
||
### Run | ||
|
||
Run as PHP | ||
|
||
php phpbot404.php | ||
|
||
or Upstart service | ||
|
||
start phpbot404 | ||
|
||
Restart | ||
|
||
restart phpbot404 | ||
|
||
Stop | ||
|
||
stop phpbot404 | ||
|
||
## Forked from | ||
[Pogosheep/IRC-BOT](https://github.com/pogosheep/IRC-Bot) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
env USER="www-data" | ||
env SCRIPT_DIR="/var/www/private/IRC-Bot-404" | ||
env LOG_FILE="/var/log/phpbot404.log" | ||
|
||
description "PHP Bot 404 startup script" | ||
author "matejvelikonja" | ||
|
||
start on startup | ||
stop on shutdown | ||
|
||
script | ||
exec /usr/bin/sudo -u $USER /usr/bin/php $SCRIPT_DIR/phpbot404.php >> $LOG_FILE | ||
end script |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters