mirror of
https://gitlab.com/ceda_ei/Zeeth-Naaw-Bot
synced 2025-03-12 16:26:52 +01:00
Add if clause to send warning if more than one user points to a user.
This commit is contained in:
parent
df78a02d3e
commit
229a343ebd
@ -33,6 +33,16 @@ function get_chain_from_user($user) {
|
||||
while (true) {
|
||||
$query = "SELECT user_id, username from users where follows = $last_user_id ;";
|
||||
$result = $conn->query($query);
|
||||
if ($result->num_rows > 1) {
|
||||
$text = "Chain is unstable. The following users are pointing to ";
|
||||
$op = $conn->query("select username from users where user_id = $last_user_id;");
|
||||
$text .= $op->fetch_assoc()['username'] . "\n";
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
$text .= '@' . $row['username'] . "\n";
|
||||
}
|
||||
send_text($text);
|
||||
mysql_data_seek($result, 0);
|
||||
}
|
||||
if ($result->num_rows > 0){
|
||||
# Code executed if this isn't the last user
|
||||
$details = $result->fetch_assoc();
|
||||
|
Loading…
x
Reference in New Issue
Block a user