fix: split option no char

This commit is contained in:
Neko Life 2021-05-27 22:50:43 +00:00
parent 8dd4dcff52
commit 51b70ea2f7
3 changed files with 14 additions and 12 deletions

View file

@ -18,7 +18,7 @@ module.exports = class mesemb extends commando.Command {
const message = await getChannelMessage(this.client,msg,args[0],args[1]); const message = await getChannelMessage(this.client,msg,args[0],args[1]);
console.log(message.embeds); console.log(message.embeds);
const mesemb = '```js\n'+JSON.stringify(message.embeds, null, 2)+'```'; const mesemb = '```js\n'+JSON.stringify(message.embeds, null, 2)+'```';
const result = await trySend(this.client, msg, {content:'Collected:'+mesemb,split:{maxLength:2000,char: ", " || ",\n" || ". " || ".\n" || "," || ".",append:',```',prepend:'```js\n'}}); const result = await trySend(this.client, msg, {content:'Collected:'+mesemb,split:{maxLength:2000,char: ",",append:',```',prepend:'```js\n'}});
return ranLog(msg,'mesemb',result.content); return ranLog(msg,'mesemb',result.content);
} catch (e) { } catch (e) {
noPerm(msg); noPerm(msg);

View file

@ -26,11 +26,11 @@ module.exports = class mesinfo extends commando.Command {
const sendMentionInfo = 'Mentions:```js\n'+JSON.stringify(mentionJSON, null, 2)+'```'; const sendMentionInfo = 'Mentions:```js\n'+JSON.stringify(mentionJSON, null, 2)+'```';
const Attachments = 'Attachments:```js\n'+JSON.stringify(message.attachments, null, 2)+'```'; const Attachments = 'Attachments:```js\n'+JSON.stringify(message.attachments, null, 2)+'```';
const sendmesinfo = mesinfo+sendMentionInfo+Attachments; const sendmesinfo = mesinfo+sendMentionInfo+Attachments;
const result1 = await trySend(this.client, msg, {content:sendmesinfo,split:{maxLength:2000,char: ", " || ",\n" || ". " || ".\n" || "," || ".",append:',```',prepend:'```js\n'}}); const result1 = await trySend(this.client, msg, {content:sendmesinfo,split:{maxLength:2000,char: ",",append:',```',prepend:'```js\n'}});
return ranLog(msg,'mesinfo',`${result1}`); return ranLog(msg,'mesinfo',`${result1}`);
} catch (e) { } catch (e) {
noPerm(msg); noPerm(msg);
return errLog(e, msg, this.client, false, "", false, defaultErrorLogChannel); return errLog(e, msg, this.client);
} }
} }
} }

View file

@ -14,12 +14,14 @@ module.exports = class uinfo extends commando.Command {
} }
async run(msg, arg) { async run(msg, arg) {
try { try {
let profile, let profile;
hmm;
if (arg.length > 0) { if (arg.length > 0) {
hmm = cleanMentionID(arg); const hmm = cleanMentionID(arg);
if (/^\d{17,19}$/.test(hmm)) { if (/^\d{17,19}$/.test(hmm)) {
profile = this.client.users.cache.get(hmm); profile = this.client.users.cache.get(hmm);
if (!profile) {
profile = await this.client.users.fetch(hmm);
}
} else { } else {
profile = findMemberRegEx(msg, hmm)[0].user; profile = findMemberRegEx(msg, hmm)[0].user;
} }
@ -27,20 +29,20 @@ module.exports = class uinfo extends commando.Command {
profile = msg.author; profile = msg.author;
} }
const member = msg.guild.member(profile); const member = msg.guild.member(profile);
let result = 'User: '+profile.tag+'```js\n'; let result = "";
if (profile) { if (profile) {
result = result+JSON.stringify(profile, null, 2)+'```'; result += 'User: '+profile.tag+'```js\n' + JSON.stringify(profile, null, 2)+'```';
} }
if (member) { if (member) {
result = result+'As member: '+member.displayName+'```js\n'+JSON.stringify(member, null, 2)+'```'; result += 'As member: '+member.displayName+'```js\n'+JSON.stringify(member, null, 2)+'```';
if ((member.displayColor)) { if ((member.displayColor)) {
result = result+'Display color:```js\n'+member.displayColor+'```'; result += 'Display color:```js\n'+member.displayColor+'```';
} }
} }
trySend(this.client, msg, result, {split:{maxLength:2000,char: ", " || ",\n" || ". " || ".\n" || "," || ".",append:',```',prepend:'```js\n'}}); trySend(this.client, msg, result, {split:{maxLength:2000,char: ",",append:',```',prepend:'```js\n'}});
return ranLog(msg,'profile', msg.content); return ranLog(msg,'profile', msg.content);
} catch (e) { } catch (e) {
return trySend(this.client, msg, "Ya lookin for ya lover? 404 not found."); return trySend(this.client, msg, "404 ERROR not found~");
} }
} }
}; };