Wednesday, March 4, 2020

How to Build Your First Discord Bot with Node.js

Nowadays, bots are being used for automating various tasks. Since the release of Amazon’s Alexa devices, the hype surrounding automation bots has only started to grow. Besides Alexa, other communication tools like Discord and Telegram offer APIs to develop custom bots.

This article will solely focus on creating your first bot with the exposed Discord API. Maybe the most well-known Discord bot is the Music Bot. The music bot lets you type a song name and the bot will attach a new user to your channel who plays the requested song. It’s a commonly used bot among younger people on gaming or streaming servers.

Let’s get started with creating a custom Discord bot.

By the way, you can join SitePoint’s Discord community with this link. Come talk tech with us and get notified about our new articles.

Prerequisites

  • Node.js v10 or higher installed (basic knowledge)
  • a Discord account and Discord client
  • basic knowledge of using a terminal

Step 1: Set Up Test Server

First of all, we need a test server on which we can later test our Discord bot. We can create a new server by clicking the plus icon on the left of the screen.

click create server

A pop-up will be displayed that asks you if you want to join a server or create a new one. Of course, we want to create a new server.

select create server

Next, we need to input the name for our server. To keep things simple, I’ve named the server discord_playground. If you want, you can change the server location depending on where you’re located to get a better ping.

server name

If everything went well, you should see your newly created server.

new server

Step 2: Generating Auth Token

When we want to control our bot via code, we need to register the bot first under our Discord account.

To register the bot, go to the Discord Developers Portal and log in with your account.

After logging in, you should be able to see the dashboard. Let’s create a new application by clicking the New Application button.

developer dashboard

Next, you’ll see a pop-up that asks you to input a name for your application. Let’s call our bot my-greeter-bot. By clicking the Create button, Discord will create an API application.

create application

When the application has been created, you’ll see the overview of the newly created my-greeter-bot application. You’ll see information like a client ID and client secret. This secret will be used later as the authorization token.

overview greeter bot

Now, click on the Bot menu option in the Settings menu. Discord will build our my-greeter-bot application and add a bot user to it.

add bot

When the bot has been built, you get an overview of your custom bot. Take a look at the Token section. Copy this authorization token and write it down somewhere, as we’ll need it later to connect to our bot user.

bot tab overview

The post How to Build Your First Discord Bot with Node.js appeared first on SitePoint.


by Michiel Mulders via SitePoint

LinkedIn determine to bring stories on its platform

Like in human beings, companies also adopt their competitor's strategies. That’s the reason why Facebook shamelessly copied the idea of STORIES of Snapchat due to which Instagram and other social media sites platform introduced Status and Stories. Now, LinkedIn is also planning to copy the idea...

[ This is a content summary only. Visit our website https://ift.tt/1b4YgHQ for full links, other content, and more! ]

by aqsqa qadir via Digital Information World

Tuesday, March 3, 2020

Facebook 3D Photos Feature Lands To Mid-Range Smartphones, Creates Depth For All Kinds of Images

It all started back in 2018 when Facebook came out with the initial introduction of 3D photos - a feature that takes the help of in-depth data to create images that can be seen from different angles, all within the implications of virtual reality headsets. Previously desktop users of Facebook...

[ This is a content summary only. Visit our website https://ift.tt/1b4YgHQ for full links, other content, and more! ]

by Daniyal Malik via Digital Information World

Google to Assign you a Public Profile Card that will be Displayed on the Results Page?

Try Googling a well-known celebrity or an influential figure. You will most probably notice a “knowledge panel” or “profile card” on the results page top section. This panel or card contains details about the searched figure such as links to their social networking profiles, bio etc. If rumors...

[ This is a content summary only. Visit our website https://ift.tt/1b4YgHQ for full links, other content, and more! ]

by Ali Siddiqui via Digital Information World

How to Update PHP in WordPress

Do you want a faster, more secure WordPress website? 

It’s important to keep your themes, plugins and even your WordPress software up to date, but what about PHP? WordPress runs on PHP, so upgrading to the latest version is just as important as keeping your plugins, themes and WordPress itself up to date. 

By switching to the latest version of PHP, you can improve your website’s performance, security and Search Engine Optimisation (SEO), while also providing a better user experience. 

In this quick tip, we’ll look at why PHP is so important for WordPress, and the steps you can take to ensure a smooth migration to the latest and greatest version. 

If you want to make it easy to install and manage your WordPress site, take a look at SiteGround. It comes with an easy installer, free support, and automatic updates—including the PHP version. We're happy to be able to offer a huge discount of 70% off self-managed WordPress hosting, thanks to our partnership with SiteGround.

SiteGround 70 Off Managed WordPress Hosting

Why Do I Need to Update My Website’s PHP? 

Behind-the-scenes, WordPress uses PHP as its scripting language. 

The WordPress platform supports various versions of PHP that you, or your hosting provider can install on your website's server, but there are two major reasons why you should always choose the latest version of PHP: 

A High-Performing Website 

Updating to a new version of PHP can make your website run up to 4x faster. A faster website provides a better user experience, so visitors will be more likely to stick around for longer and perform positive actions, such as signing up for your mailing list, or commenting on your latest blog post. Google also takes page loading times into consideration when ranking your website, so a PHP upgrade has the potential to boost your SEO and drive more people to your site. 

The Latest Security Features and Fixes

Hackers are discovering new exploits all the time, so it’s essential that you keep your software up to date, and PHP is no exception. New versions of PHP often introduce patches, bug fixes and security features that can help protect your website against viruses, malware, hackers and many other digital threats. 

Before You Upgrade

While you’re unlikely to encounter any major issues when installing a new version of PHP, why take the risk? To ensure a stress-free migration, you should: 

1. Backup Your WordPress Website

In the unlikely event that something goes wrong, creating a backup ensures that you have something to revert to.

2. Update All of Your Themes and Plugins 

If you’re using third party WordPress themes and plugins, then there’s no guarantee they’ll be compatible with every version of PHP. 

After upgrading, there's a chance that some of your add-ons may suddenly stop working. If you’re using a popular theme or plugin that’s regularly updated, then it’s unlikely you’ll encounter any major issues—but it’s not impossible. 

To reduce the chances of encountering compatibility issues, you should check that you have the latest versions of all your themes and plugins:

  • Log into your WordPress account, if you haven’t already.
  • Navigate to Dashboard > Updates.

You can now view all the available updates. 

Make sure you have the latest version of all your WordPress themes and plugins

While you’re here, you should also verify that you’re running the latest version of WordPress, by giving the Check Again button a click. 

Check that youre running the latest version of the WordPress software

If an update is available, then make sure you install it.

3. Check PHP Compatibility

Once you’re running the latest version of all your themes and plugins, you should scan for any outstanding issues with PHP compatibility. 

You can test your themes and plugins against various versions of PHP, using the free PHP Compatibility Checker:

  • In WordPress, navigate to Plugins > Add New.
  • Search for PHP Compatibility Checker.
  • When the plugin appears, select Install Now > Activate.
  • In WordPress’ left-hand menu, navigate to Tools > PHP Compatibility.
  • Select the version of PHP that you’re planning to upgrade to, which will usually be the most recent version. 
You can check for PHP compatibility issues using a free WordPress plugin
  • Choose between the following options: Only scan active plugins and themes or Scan all plugins and themes.
  • Give the Scan site button a click.

The plugin will now perform a scan, and report any compatibility issues with your themes and plugins.

If PHP Compatibility Checker does identify a problem, then you can either search for an alternative plugin or theme that’s compatible with the latest version of PHP, or you can reach out to the developer to see whether they plan to update their PHP support.

Upgrade Your Website’s PHP 

Your version of PHP is set at the server level by your hosting company, so the process of installing a new version will vary between service providers.

If you’re unsure how to update your website’s PHP, then you can:

  • Check your hosting provider’s website, documentation or help manual for instructions.
  • Boot up your favourite search engine and search for update WordPress PHP followed by the name of your hosting provider.
  • Contact your hosting provider directly, as they may need to update your website’s PHP manually.

If you’ve never upgraded your WordPress website before, then you may be wondering just how complex and time-consuming this process can be. Although it does vary between service providers, in this final section I’ll show you how to quickly and easily upgrade to the very latest version of PHP, using SiteGround

Automatic PHP Updates With SiteGround 

SiteGround provides managed WordPress hosting that’s officially recommended by WordPress.org. 

By opting for SiteGround you can automate much of the setup and maintenance involved in running a successful WordPress website. You’ll also have access to some useful WordPress management tools, including Let’s Encrypt Standard and Wildcard SSL certificates, a built-in webmail interface, the SpamExperts service, and daily backups.

Managed WordPress Hosting From SiteGround

And thanks to our partnership with SiteGround, you can get up to 70% off the cost of your managed WordPress hosting.

SiteGround users can update to the latest version of PHP, in just a few steps: 

  • Log into your cPanel account.
  • Navigate to 1H Software > PHP Version Manager.
  • Select the directory where you want to apply this update. Note that when you upgrade a directory, all of its subdirectories will be upgraded automatically. 
  • Select which version of PHP you want to use, and then click Save.

Alternatively, you can tell SiteGround to automatically install new versions of PHP as they become available:

  • Navigate to 1H Software > PHP Version Manager, and then select the directory that should receive these automatic updates. 
  • Select Managed PHP version.
  • Click Save.

And that’s it! Your website will now always have access to the recommended version of PHP, without you ever having to update it manually.  

Conclusion 

In this article, we explored why PHP is so important for WordPress, and how you can prepare your website to ensure a smooth and error-free migration to the latest version of PHP. We also looked at an example of how WordPress hosting can provide you with access to the latest and greatest version of PHP. 

If you want to learn more about how WordPress uses PHP, then check out why WordPress uses PHP. Or you might want to take your WordPress skills to the next level, with our  Learn PHP for WordPress: First Steps course, where you’ll learn the programming language that powers WordPress.



by Jessica Thornsby via Envato Tuts+ Code

Pagination Style 74

The post Pagination Style 74 appeared first on Best jQuery.


by Admin via Best jQuery

Hover Effect Style 262

The post Hover Effect Style 262 appeared first on Best jQuery.


by Admin via Best jQuery