Skip to content

Commit

Permalink
Create example.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Lunaversitay committed Oct 2, 2016
1 parent 47bca31 commit 82a3c22
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions example.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php
include('inc/discord.php');
/**
* ez-discordwidget (MIT)
* By Lunaversity
* https://github.com/Lunaversitay/ez-discordwidget/
*/

// here's some examples

# Echo the server name

echo $discord_name;

# Echo each channel

foreach( $discord_channels as $dis_channel => $dischans ){
echo "Channel: ".$dischans['name']."<br>"; #Echos the channels
}

# Echo each member (seems to only echo online members)

foreach( $discord_users as $dis_users => $disuser ){
echo "<h1> Username: ".$disuser['username']."</h1>"; #Discord username they signed up with
echo "<h1> Nick: ".$disuser['nick']."</h1>"; #Their server nickname
echo "<h2> Status: ".$disuser['status']."</h2>"; #Their status, idle, busy, online
echo "<img src=" .$disuser['avatar_url']. "><br><hr>"; #Avatar
}

/*
There are others such as:
channel_id (userside)
suppress (userside)
mute (userside)
self_mute (userside)
self_deafen (userside)
you can find them all when you grab your widget ID.
*/
?>

0 comments on commit 82a3c22

Please sign in to comment.