Skip to content

Commit

Permalink
Changed Discord URL
Browse files Browse the repository at this point in the history
  • Loading branch information
GodMod committed Jul 17, 2020
1 parent ccf111e commit 61be32e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions admin/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function save(){
public function ajaxGuildID(){
$arrDiscordConfig = $this->config->get_config('discord');
$token = $arrDiscordConfig['bot_token'];
$result = register('urlfetcher')->fetch('https://discordapp.com/api/users/@me/guilds', array('Authorization: Bot '.$token));
$result = register('urlfetcher')->fetch('https://discord.com/api/users/@me/guilds', array('Authorization: Bot '.$token));
if($result){
$arrJSON = json_decode($result, true);

Expand Down Expand Up @@ -100,7 +100,7 @@ private function fields(){

$arrValues = $this->config->get_config('discord');
if($arrValues['bot_client_id'] != ""){
$arrFields['general']['bot_token']['after_txt'] = '<div><br /><a href="https://discordapp.com/oauth2/authorize?&client_id='.$arrValues['bot_client_id'].'&scope=bot&permissions=522304" target="_blank" class="button" onclick="init_functions()">'.$this->user->lang('discord_autorize_bot').'</a></div>';
$arrFields['general']['bot_token']['after_txt'] = '<div><br /><a href="https://discord.com/oauth2/authorize?&client_id='.$arrValues['bot_client_id'].'&scope=bot&permissions=522304" target="_blank" class="button" onclick="init_functions()">'.$this->user->lang('discord_autorize_bot').'</a></div>';
}

if($arrValues['bot_client_id'] == "" && $arrValues['bot_token'] == ""){
Expand Down
2 changes: 1 addition & 1 deletion discord_plugin_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static function __shortcuts()
return array_merge(parent::$shortcuts, $shortcuts);
}

public $version = '1.2.4';
public $version = '1.2.5';
public $build = '';
public $copyright = 'GodMod';
public $vstatus = 'Stable';
Expand Down
2 changes: 1 addition & 1 deletion hooks/discord_avatar_provider_hook.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function cacheImage($strEQdkpUsername, $intEQdkpUserID, $intSize){
$arrDiscordConfig = $this->config->get_config('discord');
$guild = $arrDiscordConfig['guild_id'];
$token = $arrDiscordConfig['bot_token'];
$result = register('urlfetcher')->fetch('https://discordapp.com/api/guilds/'.$guild.'/members?limit=1000', array('Authorization: Bot '.$token));
$result = register('urlfetcher')->fetch('https://discord.com/api/guilds/'.$guild.'/members?limit=1000', array('Authorization: Bot '.$token));
$strUserID = $strAvatarHash = false;

if($result){
Expand Down
8 changes: 4 additions & 4 deletions portal/discordpostviewer.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function getChannels($blnReturnRaw = false){
$guildid = $arrDiscordConfig['guild_id'];
$token = $arrDiscordConfig['bot_token'];

$result = register('urlfetcher')->fetch('https://discordapp.com/api/guilds/'.$guildid.'/channels', array('Authorization: Bot '.$token));
$result = register('urlfetcher')->fetch('https://discord.com/api/guilds/'.$guildid.'/channels', array('Authorization: Bot '.$token));
if($result){
$arrJSON = json_decode($result, true);

Expand Down Expand Up @@ -100,7 +100,7 @@ public function getPosts($arrPrivateforums, $black_or_white, $topicnumber, $show
$arrData[] = array(
'username' => $arrPost['author']['username'],
'content' => nl2br($Parsedown->text($arrPost['content'])),
'topic_link' => 'https://discordapp.com/channels/'.$guildid.'/'.$forumID,
'topic_link' => 'https://discord.com/channels/'.$guildid.'/'.$forumID,
'topic_title' => '#'.$forumName,
'posttime' => $arrPost['timestamp'],
'topic_id' => $forumID,
Expand All @@ -116,7 +116,7 @@ public function getPosts($arrPrivateforums, $black_or_white, $topicnumber, $show

$this->pdc->put('discord.lastmessageid.'.$forumID, $strLastMessage, 3600*24*7);

$result = register('urlfetcher')->fetch('https://discordapp.com/api/channels/'.$forumID.'/messages?around='.$strLastMessage.'&limit='.($topicnumber*2), array('Authorization: Bot '.$token));
$result = register('urlfetcher')->fetch('https://discord.com/api/channels/'.$forumID.'/messages?around='.$strLastMessage.'&limit='.($topicnumber*2), array('Authorization: Bot '.$token));
if($result){
$arrJSON = json_decode($result, true);
if($arrJSON){
Expand All @@ -127,7 +127,7 @@ public function getPosts($arrPrivateforums, $black_or_white, $topicnumber, $show
$arrData[] = array(
'username' => $arrPost['author']['username'],
'content' => nl2br($Parsedown->text($arrPost['content'])),
'topic_link' => 'https://discordapp.com/channels/'.$guildid.'/'.$forumID,
'topic_link' => 'https://discord.com/channels/'.$guildid.'/'.$forumID,
'topic_title' => '#'.$forumName,
'posttime' => $arrPost['timestamp'],
'topic_id' => $forumID,
Expand Down
2 changes: 1 addition & 1 deletion templates/base_template/admin/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
}

function authorizebot(){
$.get('https://discordapp.com/api/gateway', function(data) {
$.get('https://discord.com/api/gateway', function(data) {
// Now that we've completed the request schedule the next one.

if(data && data != ""){
Expand Down

0 comments on commit 61be32e

Please sign in to comment.