[REQUEST] Welcome Module!

If you have created a 3rd party module you'd like other people to use, post it here
orgbot
Member
Posts: 34
Joined: Mon Aug 01, 2016 2:48 am
antispam: Rimor

[REQUEST] Welcome Module!

Postby orgbot » Mon Jul 24, 2017 7:46 pm

Hello there everyone, it's me again! - I'm working on some coding projects and I am trying to write one module which will combine stuff from some modules. I've already done it succesful in C# but I can't get it right in PHP. (The bot is a points-based system all written out)

My idea :

If you write welcome to the bot, the bot replies :
AND
If you join the channel it automatically sends the message anyway.

Welcome <name> <click> to view <bot name> news. (If new news message, it should display here)

Inside the window :

Welcome <name>
---------------------------------------------------------------------------------------------------------------------
<newsfeed>
---------------------------------------------------------------------------------------------------------------------
<tara timer>
<gautlet timer>
<gauntlet buff timer>
---------------------------------------------------------------------------------------------------------------------
You have <points> points. <account> -> This will be clickable to open the account-history logs.
Your main is: <main char> [ALTS] -> Clickable to view alts.
Autoinvite preferences : [ON] / [OFF] -> Clickable with both ability to turn autinvite on and off.
---------------------------------------------------------------------------------------------------------------------

Is there anyone who could possibly help me out with this?

Greetings!
orgbot
Member
Posts: 34
Joined: Mon Aug 01, 2016 2:48 am
antispam: Rimor

Re: [REQUEST] Welcome Module!

Postby orgbot » Mon Jul 24, 2017 7:57 pm

Image

This is the version in C#, and this is also the idea I have in mind for PHP, but a bit more optimized.

ALL help is VERY! welcome!

Thanks in advance :D
Tyrence
Posts: 1956
Joined: Sat Jan 09, 2010 1:32 am

Re: [REQUEST] Welcome Module!

Postby Tyrence » Tue Jul 25, 2017 12:43 am

<?php

/// You can use whatever namespace you want but typically you want something that identifies yourself.
namespace orgbot\Modules;

/// note that we use an annotation library in Budabot, which means that some comments are more than just "Comments"
/// annotations are defined in a comment and start with @, you will see it in several places in a controller
/**
* Author:
* - orgbot (RK2)
* /// Author is not required but is nice in case you release the module and people have questions about it
*
* @Instance /// required, this tells Budabot to manage an instance of class, which is what you want
*
* Commands this controller contains:
* /// an example of a !welcome command if you later want to add one
* @DefineCommand(
* command = 'welcome',
* accessLevel = 'all',
* description = 'Shows current news and points',
* help = 'welcome.txt'
* )
*/
class WelcomeController { /// choose a good a name for your controller

/// Budabot will set this value to "WELCOME_MODULE" or whatever module you add it to
/**
* Name of the module.
* Set automatically by module loader.
*/
public $moduleName;

/// these are dependencies that you controller relies on, this will change depending on what you want to do, this using the @Inject annotation
/// you can use this to inject an instance of any class with the @Instance annotation, including other controllers
/// just make sure the variable name matches the class name
/** @Inject */
public $chatBot;

/** @Inject */
public $db;

/** @Inject */
public $util;

/** @Inject */
public $text;

/// using @Setup annotation
/**
* @Setup
*/
public function setup() {
/// if you had a sql file to load you would load it here
/// this assumes a welcome.sql file that exists in the WELCOME_MODULE folder
//$this->db->loadSQLFile($this->moduleName, "welcome");
}

/// handler for welcome command, if you choose later to add one
/// @HandlesCommand is required, must match command name from above
/// @Matches is required, this is the regex that the input must match from the user, otherwise the bot will show them the help file
/**
* @HandlesCommand("welcome")
* @Matches("/^welcome$/i")
*/
public function welcomeCommand($message, $channel, $sender, $sendto, $args) {
/// $sender is the name of the character who called the command
$msg = $this->getWelcomeInfo($sender);

/// $sendto->reply is usually what you use to reply to a command
/// if will reply in the channel that the command what made it, or in a tell if the command was sent in a tell
$sendto->reply($msg);
}

/// this specifies an event handler for when someone joins the private channel
/**
* @Event("joinPriv")
* @Description("Displays a welcome message when a character joins the private channel")
*/
public function joinPrivateChannelMessageEvent($eventObj) {
/// get the name of the character who joined the private channel
$sender = $eventObj->sender;

$msg = $this->getWelcomeInfo($sender);

/// since this isn't a command, we can't use $sendto->reply() so we tell the bot to send a tell to the character
$this->chatBot->sendTell($msg, $sender);
}

public function getWelcomeInfo($sender) {
/// get the list news items from the NEWS_MODULE, we query the database using the db instance
$data = $this->db->query("SELECT * FROM `news` WHERE deleted = 0 ORDER BY `time` DESC LIMIT 3");

/// create blob window
/// budabot uses a modified tag language, for tags that have an opening and closing tag, the closing tag is always <end>
/// \n will be translated into a new line, but you must use double quotes for this to work
/// budabot will automatically add a main header based on the value passed to the makeBlob() function
$blob = "";

/// use <header2> for subheaders
$blob .= "<header>Current News Items<end>\n\n";
forEach($data as $row) {
/// we use $this->util->date() for date formatting so that it can be changed by bot admin across the entire bot
$blob .= $this->util->date($row->time) . " by " . $row->name . "\n";
$blob .= $row->news . "\n\n";
}

$blob .= "\n<header>Raid Timers<end>\n\n";
$blob .= "TODO\n";

$blob .= "\n\n<header>Points<end>\n\n";
$blob .= "TODO\n";

/// create a link for the blob
/// <myname> will get replaced with the name of the bot
/// "Welcome $sender to <myname>" will be the text of the link as well as the main header for the blob window
$msg = $this->text->makeBlob("Welcome $sender to <myname>", $blob);

return $msg;
}
}
"Those who expect to reap the blessings of freedom, must, like men, undergo the fatigues of supporting it." — Thomas Paine
"Nearly all men stand adversity, but if you want to test a man's character, give him power." — Abraham Lincoln
Budabot Releases and Downloads: https://github.com/Budabot/Budabot/releases
Tyrence
Posts: 1956
Joined: Sat Jan 09, 2010 1:32 am

Re: [REQUEST] Welcome Module!

Postby Tyrence » Tue Jul 25, 2017 12:51 am

So you'll want to make a folder for your module, maybe WELCOME_MODULE or similar. Then inside you'll have one or more controllers. So in this case I might call it WelcomeController.php. Here is an example. I prefixed my commentary with triple slashes (///). One common gotcha is that you must use the form $this->methodName() or $this->varname when referencing instance variables or methods. This comes into play most often when calling methods on injected dependencies: $this->chatBot->sendTell(), not $chatBot->sendTell(). This is due to PHP syntax rules. I tested this code and it works in the latest version of Budabot (3.5_RC1) so if you are running that version (I recommend it, will make upgrading to later versions easier) you can take it and then just modify it to suit your needs. In this example, the welcome message will be shown when a character enters the private channel or whenever someone executes the !welcome command.

Code: Select all

<?php

/// You can use whatever namespace you want but typically you want something that identifies yourself.
namespace orgbot\Modules;

/// note that we use an annotation library in Budabot, which means that some comments are more than just "Comments"
/// annotations are defined in a comment and start with @, you will see it in several places in a controller
/**
 * Author:
 *  - orgbot (RK2)
 * /// Author is not required but is nice in case you release the module and people have questions about it
 *
 * @Instance /// required, this tells Budabot to manage an instance of class, which is what you want
 *
 * Commands this controller contains:
 * /// an example of a !welcome command if you later want to add one
 *   @DefineCommand(
 *      command     = 'welcome',
 *      accessLevel = 'all',
 *      description = 'Shows current news and points',
 *      help        = 'welcome.txt'
 *   )
 */
class WelcomeController { /// choose a good a name for your controller

   /// Budabot will set this value to "WELCOME_MODULE" or whatever module you add it to
   /**
    * Name of the module.
    * Set automatically by module loader.
    */
   public $moduleName;

   /// these are dependencies that you controller relies on, this will change depending on what you want to do, this using the @Inject annotation
   /// you can use this to inject an instance of any class with the @Instance annotation, including other controllers
   /// just make sure the variable name matches the class name
   /** @Inject */
   public $chatBot;
   
   /** @Inject */
   public $db;

   /** @Inject */
   public $util;

   /** @Inject */
   public $text;
   
   /// using @Setup annotation
   /**
    * @Setup
    */
   public function setup() {
      /// if you had a sql file to load you would load it here
      /// this assumes a welcome.sql file that exists in the WELCOME_MODULE folder
      //$this->db->loadSQLFile($this->moduleName, "welcome");
   }
   
   /// handler for welcome command, if you choose later to add one
   /// @HandlesCommand is required, must match command name from above
   /// @Matches is required, this is the regex that the input must match from the user, otherwise the bot will show them the help file
   /**
    * @HandlesCommand("welcome")
    * @Matches("/^welcome$/i")
    */
   public function welcomeCommand($message, $channel, $sender, $sendto, $args) {
      /// $sender is the name of the character who called the command
      $msg = $this->getWelcomeInfo($sender);
      
      /// $sendto->reply is usually what you use to reply to a command
      /// if will reply in the channel that the command what made it, or in a tell if the command was sent in a tell
      $sendto->reply($msg);
   }

   /// this specifies an event handler for when someone joins the private channel
   /**
    * @Event("joinPriv")
    * @Description("Displays a welcome message when a character joins the private channel")
    */
   public function joinPrivateChannelMessageEvent($eventObj) {
      /// get the name of the character who joined the private channel
      $sender = $eventObj->sender;
      
      $msg = $this->getWelcomeInfo($sender);
      
      /// since this isn't a command, we can't use $sendto->reply() so we tell the bot to send a tell to the character
      $this->chatBot->sendTell($msg, $sender);
   }

   public function getWelcomeInfo($sender) {
      /// get the list news items from the NEWS_MODULE, we query the database using the db instance
      $data = $this->db->query("SELECT * FROM `news` WHERE deleted = 0 ORDER BY `time` DESC LIMIT 3");
      
      /// create blob window
      /// budabot uses a modified tag language, for tags that have an opening and closing tag, the closing tag is always <end>
      /// \n will be translated into a new line, but you must use double quotes for this to work
      /// budabot will automatically add a main header based on the value passed to the makeBlob() function
      $blob = "";
      
      /// use <header2> for subheaders
      $blob .= "<header>Current News Items<end>\n\n";
      forEach($data as $row) {
         /// we use $this->util->date() for date formatting so that it can be changed by bot admin across the entire bot
         $blob .= $this->util->date($row->time) . " by " . $row->name . "\n";
         $blob .= $row->news . "\n\n";
      }

      $blob .= "\n<header>Raid Timers<end>\n\n";
      $blob .= "TODO\n";
      
      $blob .= "\n\n<header>Points<end>\n\n";
      $blob .= "TODO\n";
      
      /// create a link for the blob
      /// <myname> will get replaced with the name of the bot
      /// "Welcome $sender to <myname>" will be the text of the link as well as the main header for the blob window
      $msg = $this->text->makeBlob("Welcome $sender to <myname>", $blob);
      
      return $msg;
   }
}
"Those who expect to reap the blessings of freedom, must, like men, undergo the fatigues of supporting it." — Thomas Paine
"Nearly all men stand adversity, but if you want to test a man's character, give him power." — Abraham Lincoln
Budabot Releases and Downloads: https://github.com/Budabot/Budabot/releases
orgbot
Member
Posts: 34
Joined: Mon Aug 01, 2016 2:48 am
antispam: Rimor

Re: [REQUEST] Welcome Module!

Postby orgbot » Sat Sep 23, 2017 3:56 pm

Hi guys. My computer crashed unfortunately, but I am back and I appreciate the feedback. I'll do some testing with it :-)
orgbot
Member
Posts: 34
Joined: Mon Aug 01, 2016 2:48 am
antispam: Rimor

Re: [REQUEST] Welcome Module!

Postby orgbot » Sat Sep 23, 2017 5:13 pm

All of the above work, now trying to figure out how to get the rest displayed, thank you very much!
orgbot
Member
Posts: 34
Joined: Mon Aug 01, 2016 2:48 am
antispam: Rimor

Re: [REQUEST] Welcome Module!

Postby orgbot » Sat Sep 23, 2017 6:49 pm

I am working on getting the <points> and <account> in my window, but I keep getting "You have Array points" - It won't go to the number. What am I doing wrong?
Tyrence
Posts: 1956
Joined: Sat Jan 09, 2010 1:32 am

Re: [REQUEST] Welcome Module!

Postby Tyrence » Sat Sep 23, 2017 8:14 pm

The value you are printing out is an array, you may need to pull the value out of it that you want. It might help to post your code.
"Those who expect to reap the blessings of freedom, must, like men, undergo the fatigues of supporting it." — Thomas Paine
"Nearly all men stand adversity, but if you want to test a man's character, give him power." — Abraham Lincoln
Budabot Releases and Downloads: https://github.com/Budabot/Budabot/releases
orgbot
Member
Posts: 34
Joined: Mon Aug 01, 2016 2:48 am
antispam: Rimor

Re: [REQUEST] Welcome Module!

Postby orgbot » Sat Sep 23, 2017 8:42 pm

I am still doing some tests, but here it is ;


<?php

/// You can use whatever namespace you want but typically you want something that identifies yourself.
namespace orgbot\Modules;

/// note that we use an annotation library in Budabot, which means that some comments are more than just "Comments"
/// annotations are defined in a comment and start with @, you will see it in several places in a controller
/**
* Author:
* - Loreen (RK2)
* @Instance /// required, this tells Budabot to manage an instance of class, which is what you want
*
* Commands this controller contains:
* /// an example of a !welcome command if you later want to add one
* @DefineCommand(
* command = 'welcome',
* accessLevel = 'all',
* description = 'Shows current news and points',
* help = 'welcome.txt'
* )
*/
class WelcomeController { /// choose a good a name for your controller
/// Budabot will set this value to "WELCOME_MODULE" or whatever module you add it to
/**
* Name of the module.
* Set automatically by module loader.
*/
public $moduleName;

/// these are dependencies that you controller relies on, this will change depending on what you want to do, this using the @Inject annotation
/// you can use this to inject an instance of any class with the @Instance annotation, including other controllers
/// just make sure the variable name matches the class name
/** @Inject */
public $chatBot;

/** @Inject */
public $db;

/** @Inject */
public $util;

/** @Inject */
public $text;
/** @Inject */
public $main; // The main for this character

/// using @Setup annotation
/**
* @Setup
*/
public function setup() {
/// if you had a sql file to load you would load it here
/// this assumes a welcome.sql file that exists in the WELCOME_MODULE folder
$this->db->loadSQLFile($this->moduleName, "news");
$this->db->loadSQLFile($this->moduleName, "player_points");
$this->db->loadSQLFile($this->moduleName, "player_points_log");
$this->db->loadSQLFile($this->moduleName, "private_chat");
$this->db->loadSQLFile($this->moduleName, "alts");
}

/// handler for welcome command, if you choose later to add one
/// @HandlesCommand is required, must match command name from above
/// @Matches is required, this is the regex that the input must match from the user, otherwise the bot will show them the help file
/**
* @HandlesCommand("welcome")
* @Matches("/^welcome$/i")
*/
public function welcomeCommand($message, $channel, $sender, $sendto, $args) {
/// $sender is the name of the character who called the command
$msg = $this->getWelcomeInfo($sender);

/// $sendto->reply is usually what you use to reply to a command
/// if will reply in the channel that the command what made it, or in a tell if the command was sent in a tell
$sendto->reply($msg);
}

/// this specifies an event handler for when someone joins the private channel
/**
* @Event("joinPriv")
* @Description("Displays a welcome message when a character joins the private channel")
*/
public function joinPrivateChannelMessageEvent($eventObj) {
/// get the name of the character who joined the private channel
$sender = $eventObj->sender;

$msg = $this->getWelcomeInfo($sender);

/// since this isn't a command, we can't use $sendto->reply() so we tell the bot to send a tell to the character
$this->chatBot->sendTell($msg, $sender);
}

public function getWelcomeInfo($sender) {
/// get the list news items from the NEWS_MODULE, we query the database using the db instance
$data = $this->db->query("SELECT * FROM `news` WHERE deleted = 0 ORDER BY `time` DESC LIMIT 3");
$player = $this->getMainOrDefault($sender);
$player_points = $this->db->query("SELECT * FROM player_points_<myname> WHERE name = ?", $player);
$accountlink = $this->text->makechatcmd("Account", "/tell <myname> account");
$msg1 = "You have [<yellow>$player_points<end>] points. $accountlink ";
$sql = "SELECT `alt`, `main`, `validated`, p.* FROM `alts` a LEFT JOIN players p ON (a.alt = p.name AND p.dimension = '<dim>') WHERE `main` LIKE ? ORDER BY level DESC, ai_level DESC, profession ASC, name ASC";
$data1 = $this->db->query($sql, $this->main);
$altslink = $this->text->makechatcmd("[ALTS]", "/tell <myname> alts");
$msg = "Your main is currently [<yellow>$data1<end>]. $altslink ";

/// create blob window
/// budabot uses a modified tag language, for tags that have an opening and closing tag, the closing tag is always <end>
/// \n will be translated into a new line, but you must use double quotes for this to work
/// budabot will automatically add a main header based on the value passed to the makeBlob() function
$blob = "";

/// use <header2> for subheaders
$blob .= "<header>Current News Items<end>\n";
forEach($data as $row) {
/// we use $this->util->date() for date formatting so that it can be changed by bot admin across the entire bot
$blob .= $this->util->date($row->time) . " by " . $row->name . "\n";
$blob .= "<yellow>$row->news<end>" . "\n";
}

$blob .= "\n<header>Raid Timers<end>\n";
$blob .= "Gauntlet spawns in <yellow>$gauntgetTime<end> $list\n";

$blob .="\n<header>Gauntlet buff<end>\n";
$blob .= "$gaubuff";

$blob .= "\n<header>Points<end>\n";
$blob .= "$msg1\n";

$blob .= "\n<header>Alts<end>\n";
$blob .= "$msg\n";

/// create a link for the blob
/// <myname> will get replaced with the name of the bot
/// "Welcome $sender to <myname>" will be the text of the link as well as the main header for the blob window
$msg = $this->text->makeBlob("Welcome $sender to <myname>", $blob);

return $msg;
}

private function getMainOrDefault($player) {
$sql = "SELECT `alt`, `main` FROM `alts` WHERE (`main` LIKE ?) OR (`main` LIKE (SELECT `main` FROM `alts` WHERE `alt` LIKE ?))";
$playerWithAlts = $this->db->query($sql, $player, $player);
}

private function tmTime($zz) {
//This wouldnt be necessary if you would add timezone option for the bot into the configs
$gtime = new DateTime();
$gtime->setTimestamp($zz);
$gtime->setTimezone(new DateTimeZone($this->settingManager->get('gauntlet_timezone')));
return $gtime->format("l G:i (j.n.y)");
}

public function gauntgetTime($zz) {
//This wouldnt be necessary if you would add timezone option for the bot into the configs
if ($timer === null) {
return 0;
} else {
return $this->tmTime($timer->endtime + 61620*$zz);
}
}
}
orgbot
Member
Posts: 34
Joined: Mon Aug 01, 2016 2:48 am
antispam: Rimor

Re: [REQUEST] Welcome Module!

Postby orgbot » Mon Sep 25, 2017 10:52 am

Update :

I have managed to get the amount of points to be displayed, but now I can't get rid of the decimal, I'd like it to display : "You have 5 points, You have 10 points, or if 0 ; You have 0 points" here is the code :

<?php

/// You can use whatever namespace you want but typically you want something that identifies yourself.
namespace orgbot\Modules;
/// note that we use an annotation library in Budabot, which means that some comments are more than just "Comments"
/// annotations are defined in a comment and start with @, you will see it in several places in a controller
/**
* Author:
* - Loreen (RK2)
* @Instance /// required, this tells Budabot to manage an instance of class, which is what you want
*
* Commands this controller contains:
* /// an example of a !welcome command if you later want to add one
* @DefineCommand(
* command = 'welcome',
* accessLevel = 'all',
* description = 'Shows current news and points',
* help = 'welcome.txt'
* )
*/
class WelcomeController { /// choose a good a name for your controller
/// Budabot will set this value to "WELCOME_MODULE" or whatever module you add it to
/**
* Name of the module.
* Set automatically by module loader.
*/
public $moduleName;

/// these are dependencies that you controller relies on, this will change depending on what you want to do, this using the @Inject annotation
/// you can use this to inject an instance of any class with the @Instance annotation, including other controllers
/// just make sure the variable name matches the class name
/** @Inject */
public $chatBot;

/** @Inject */
public $db;

/** @Inject */
public $util;

/** @Inject */
public $text;

/// using @Setup annotation
/**
* @Setup
*/
public function setup() {
/// if you had a sql file to load you would load it here
/// this assumes a welcome.sql file that exists in the WELCOME_MODULE folder
$this->db->loadSQLFile($this->moduleName, "news");
$this->db->loadSQLFile($this->moduleName, "player_points");
$this->db->loadSQLFile($this->moduleName, "player_points_log");
$this->db->loadSQLFile($this->moduleName, "private_chat");
$this->db->loadSQLFile($this->moduleName, "alts");
}

/// handler for welcome command, if you choose later to add one
/// @HandlesCommand is required, must match command name from above
/// @Matches is required, this is the regex that the input must match from the user, otherwise the bot will show them the help file
/**
* @HandlesCommand("welcome")
* @Matches("/^welcome$/i")
*/
public function welcomeCommand($message, $channel, $sender, $sendto, $args) {
/// $sender is the name of the character who called the command
$msg = $this->getWelcomeInfo($sender);

/// $sendto->reply is usually what you use to reply to a command
/// if will reply in the channel that the command what made it, or in a tell if the command was sent in a tell
$sendto->reply($msg);
}

/// this specifies an event handler for when someone joins the private channel
/**
* @Event("joinPriv")
* @Description("Displays a welcome message when a character joins the private channel")
*/
public function joinPrivateChannelMessageEvent($eventObj) {
/// get the name of the character who joined the private channel
$sender = $eventObj->sender;

$msg = $this->getWelcomeInfo($sender);

/// since this isn't a command, we can't use $sendto->reply() so we tell the bot to send a tell to the character
$this->chatBot->sendTell($msg, $sender);
}

public function getWelcomeInfo($sender) {
/// get the list news items from the NEWS_MODULE, we query the database using the db instance
$data = $this->db->query("SELECT * FROM `news` WHERE deleted = 0 ORDER BY `time` DESC LIMIT 3");
$accountlink = $this->text->makechatcmd("Account", "/tell <myname> account");
$altslink = $this->text->makechatcmd("ALTS", "/tell <myname> alts");
$autolink = $this->text->makechatcmd("ON", "/tell <myname> autoinvite on");
$autofflink = $this->text->makechatcmd("OFF", "/tell <myname> autoinvite off");


/// create blob window
/// budabot uses a modified tag language, for tags that have an opening and closing tag, the closing tag is always <end>
/// \n will be translated into a new line, but you must use double quotes for this to work
/// budabot will automatically add a main header based on the value passed to the makeBlob() function
$blob = "";

/// use <header2> for subheaders
$blob .= "<header>Current News Items<end>\n";
forEach($data as $row) {
/// we use $this->util->date() for date formatting so that it can be changed by bot admin across the entire bot
$blob .= $this->util->date($row->time) . " by " . "<yellow>$row->name<end>" . "\n";
$blob .= "<yellow>$row->news<end>" . "\n";
}
$blob .= "\n<yellow>Raid timers<end>";
$blob .= "\n<yellow>Gauntlet<end><white> becomes killable in<end> <yellow>Hours/Minutes/Seconds(Numbers)<end> <white>hours(word)<end>";
$blob .= "\n<yellow>Tarasque<end><white> becomes killable in<end> <yellow>Hours/Minutes/Seconds(Numbers)<end> <white>hours(word)<end>\n";

//$blob .="\n<yellow>Gauntlet buff<end><white> is currently<end><green> available<end><white> it<end> <red>despawns<end><white> in<end> <yellow>5<end> <white>hours<end>\n";

$player = $this->getMainOrDefault($sender);
$player_points = $this->db->query("SELECT * FROM player_points_<myname> WHERE name = ?", $player);
if (count($player_points) > 0);
$name = $player_points[0]->name;
$points = $player_points[0]->points;
$player_points = array();
forEach($player_points as $array);
$blob .= "\n<white>You have<end> <yellow>$points<end> <white>points<end> $accountlink";
$blob .= "\n<white>Main:<end> <yellow>TODO<end> $altslink.";
$blob .="\n<white>Auto Invite settings [$autolink] | [$autofflink]<end>";

/// create a link for the blob
/// <myname> will get replaced with the name of the bot
/// "Welcome $sender to <myname>" will be the text of the link as well as the main header for the blob window
$msg = $this->text->makeBlob("Welcome $sender to <myname>", $blob);

return $msg;
}

private function getMainOrDefault($player){
$sql = "SELECT `alt`, `main` FROM `alts` WHERE (`main` LIKE ?) OR (`main` LIKE (SELECT `main` FROM `alts` WHERE `alt` LIKE ?))";
$playerWithAlts = $this->db->query($sql, $player, $player);
if (count($playerWithAlts) > 0) {
$player = $playerWithAlts[0]->main;
}

return $player;
}
}

Return to “Modules”

Who is online

Users browsing this forum: No registered users and 1 guest