mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 02:53:31 +01:00
small fixes to hb
This commit is contained in:
@@ -205,6 +205,8 @@ Commands[ "feedback" ] = {
|
|||||||
|
|
||||||
bot.getChannelLogs( message.channel, amount, function( err, logs ) {
|
bot.getChannelLogs( message.channel, amount, function( err, logs ) {
|
||||||
|
|
||||||
|
console.log(logs);
|
||||||
|
|
||||||
if ( err ) {
|
if ( err ) {
|
||||||
bot.reply( message, "an error occurred when grabbing the logs.", false, {
|
bot.reply( message, "an error occurred when grabbing the logs.", false, {
|
||||||
selfDestruct: 3000
|
selfDestruct: 3000
|
||||||
@@ -215,7 +217,7 @@ Commands[ "feedback" ] = {
|
|||||||
for ( msg of logs.contents ) {
|
for ( msg of logs.contents ) {
|
||||||
|
|
||||||
if ( ~msg.content.indexOf( "[request" ) || ~msg.content.indexOf( "[feature" || ~msg.content.indexOf( "[suggestion") ) ) {
|
if ( ~msg.content.indexOf( "[request" ) || ~msg.content.indexOf( "[feature" || ~msg.content.indexOf( "[suggestion") ) ) {
|
||||||
if(msg.content.length > 15){
|
if(msg.content.length > 10){
|
||||||
found.push( msg );
|
found.push( msg );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -229,7 +231,9 @@ Commands[ "feedback" ] = {
|
|||||||
|
|
||||||
} );
|
} );
|
||||||
|
|
||||||
bot.reply( message, "I found " + found.length + " result(s) that matched this. I'll send it to you in a PM." );
|
bot.reply( message, "I found " + found.length + " result(s) that matched this. I'll send it to you in a PM.", false, {
|
||||||
|
selfDestruct : 3000
|
||||||
|
} );
|
||||||
|
|
||||||
function gothroughit() {
|
function gothroughit() {
|
||||||
for ( msg of found ) {
|
for ( msg of found ) {
|
||||||
|
|||||||
7
index.js
7
index.js
@@ -465,7 +465,7 @@ exports.Client.prototype.sendMessage = function( destination, toSend, callback,
|
|||||||
channel_id = destination.channel.id;
|
channel_id = destination.channel.id;
|
||||||
} else if ( destination instanceof User ) {
|
} else if ( destination instanceof User ) {
|
||||||
var destId = self.PMList.deepFilter( [ "user", "id" ], destination.id, true );
|
var destId = self.PMList.deepFilter( [ "user", "id" ], destination.id, true );
|
||||||
|
|
||||||
if ( destId ) {
|
if ( destId ) {
|
||||||
channel_id = destId.id;
|
channel_id = destId.id;
|
||||||
} else {
|
} else {
|
||||||
@@ -532,6 +532,11 @@ exports.Client.prototype.getChannelLogs = function( channel, amount, callback )
|
|||||||
|
|
||||||
Internal.XHR.getChannelLogs( self.token, channel.id, ( amount || 50 ), function( err, data ) {
|
Internal.XHR.getChannelLogs( self.token, channel.id, ( amount || 50 ), function( err, data ) {
|
||||||
|
|
||||||
|
if(err){
|
||||||
|
callback(err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var logs = new List( "id" );
|
var logs = new List( "id" );
|
||||||
for ( message of data ) {
|
for ( message of data ) {
|
||||||
logs.add( new Message( message, channel ) );
|
logs.add( new Message( message, channel ) );
|
||||||
|
|||||||
Reference in New Issue
Block a user