Jump to content
Sign in to follow this  
Master

[Sweater] How to make a Refresh Bot command

Recommended Posts

What you need:

  • Notepad++ , just that

 

1- Edit your Commands.php

Go to YourUsername/var/www/html/Sweater/Sweater/Plugins if VPS

Go to C:/xampp/htdocs/Sweater/Sweater/Plugins if Localhosted

 

Find Commands.php and right click on it , select Edit with Notepad++

 

Now find this line:

		'PING' => 'handlePing',

After that put:

		'BREFRESH' => 'handleRefresh',

Now in the function section , after this lines:

	private function handlePing(Array $arrArguments, Sweater\Client $objClient){
		$this->objBot->sendMessage('Pong', $objClient);
	}

Put:

	private function handleRefresh(Array $arrArguments, Sweater\Client $objClient){
				Silk\Logger::Log('Refreshing Bot');
	$this->objBot->sendMessage('Bot Refresh.', $objClient);
	}

Save the file and restart your shell. Enjoy the command!

 

This command is to do changes on the bot while running the shell without needing to restart the whole server or rejoin the room.

Share this post


Link to post
Share on other sites

I may be wrong but

I think @doodlebob is right.

 

You could just use the !PING command to:

On 6/13/2017 at 11:29 AM, Master said:

do changes on the bot while running the shell without needing to restart the whole server or rejoin the room.


It's the exact same except the !BREFRESH command logs the 'Refreshing Bot' message which is pretty unnecessary.

Spoiler
Silk\Logger::Log('Refreshing Bot');

Not sure if I misread that function but i'm pretty certain it's not needed :) 

 

 - Nico

 

Edited by Nico

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×