Search
 
SCRIPT & CODE EXAMPLE
 

PHP

restcord Guild Icon outputs 404.

# First of all you have to go to the /vendor/restcord file and 
# then you have to rewrite the following files...

                      ###########################
                      # File: src/Constants.php #
                      ###########################
namespace RestCord;

/**
 * @author Aaron Scherer <aequasi@gmail.com>
 *
 * Constants Class
 */
class Constants
{
    const CDN_URL    = 'https://cdn.discordapp.com/';

    const AVATAR_URL = self::CDN_URL.'avatars/';
    const ICON_URL = self::CDN_URL.'icons/';
}

                      ##################################
                      # File: src/Traits/IconTrait.php #
                      ##################################
namespace RestCordTraits;

use RestCordConstants;

/**
 * @author Aaron Scherer <aequasi@gmail.com>
 *
 * IconTrait Class
 */
trait IconTrait
{
    public function getIcon($format = 'webp', $size = null)
    {
        $url = Constants::ICON_URL.$this->id.'/'.$this->icon.'.'.$format;
        if ($size !== null) {
            $url .= '?size='.$size;
        }

        return $url;
    }
}
Comment

PREVIOUS NEXT
Code Example
Php :: forward parameter from blade to another blade with filter 
Php :: a backwards counting forloop 
Php :: Morocco 
Php :: iterator impliment php 
Php :: blade capitalize first letter 
Php :: remove get parameters from url php 
Php :: register acf options page 
Php :: how to forget session in laravel 
Php :: wp do sql query from function 
Php :: php pass a variabele to js 
Php :: get current page php 
Php :: how to run a specific test in laravel 
Php :: current page link using php 
Php :: composer require laravel/ui laravel 7 
Php :: contact form 7 select disabled option 
Php :: unique sql queries laravel 
Php :: laravel get query in normal sql without bindings 
Php :: Error: php@7.2 has been disabled because it is deprecated upstream! 
Php :: php regex strin start with 
Php :: php load specific post id on language 
Php :: how to redirect to previous page in php 
Php :: translate youtube link into iframe in laravel 
Php :: access storage from the view laravel 6 
Php :: first item in array php 
Php :: option value selected in laravel blade 
Php :: update json file php 
Php :: add another field in existing migration laravel 
Php :: laravel if file is image 
Php :: php remove empty values from array 
Php :: remove decimal php 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =