#development

1 messages · Page 387 of 1

nimble merlin
#

It defines our personalitys

ruby dust
#

I have a lot more arguments that can take up to 5 more hours to this convo, but I will leave it for now

nimble merlin
#

I don't like the phrase: for now

ruby dust
#

exactly

oblique sequoia
#

My messages express my emotions too. Absolutely emotionless.

nimble merlin
#

????

#

Are you being sarcastic?

#

I can't tell

ruby dust
nimble merlin
#

I didn't start this convo but i'll end it NOW!

ruby dust
#

OK!

slim heart
#

oof

gilded blaze
#

why is it when i mention a certain person it has <@!id> instead of <@id>

shrewd totem
#

If a user/bot has a nick name set in a server, they would have <@!ID> instead.

inner jewel
#

member mention

#

the client renders both correctly tho

#

¯_(ツ)_/¯

gilded blaze
#

oh

slim heart
#

Asking again, hopefully someone is awake now that can help :>, is there a way to make mysql entry's with data from EVERY server the bot is in?

earnest phoenix
#

I just noticed my bot is offline -_-

#

What?

topaz fjord
#

i feel like thats some dns shit

earnest phoenix
#

mhmm

#

Oh I got it

#

Npm needed an update

#

Woops

#

Npm update

ruby dust
#

so I was asking not too long ago about this error being printed instead of the command execution

UnicodeEncodeError: 'ascii' codec can't encode characters in position 86-98: ordinal not in range(128)```so I now kinda know it's cause, it's because it's either the server's name or the user's name contains at least one non-standard character, is there a possible way to just ignore the character alone or somethig similar? since I need to see the command execution and that error is in the way
earnest phoenix
#

You can use a regexp

#

Probably

ruby dust
#

how is that gonna help me? and is it really a thing in python?

earnest phoenix
#

Oh

#

Lol I don't know python. I completely over-looked that

ruby dust
#

heh

earnest phoenix
ruby dust
#

I do not think that regular expressions is what I'm looking for

earnest phoenix
#

Hmm, I don't know then. Sorry.

ruby dust
#

well anyway, I'm going to sleep now and won't be available for the next 15 hours, so I'm just going to find the answer by searching for a mention if anyone has an answer to my issue, thanks in advance

rain tulip
#
<div class="container is-widescreen">

            <div class="longdescription">
                <div class="content">
                    
                    <style>
    article .container:nth-of-type(5) {margin:0;padding:0;max-width:100%;width:100%;}
    article .container:nth-of-type(5) .longdescription {padding:0;}
    article .container:nth-of-type(5) .longdescription .content {padding:0;}
    article .container:nth-of-type(5) .longdescription .content iframe {height:100vH;width:100%;border:none;}
</style>
<div><iframe id="botiframe" onload="setRegularIframe('Magic 8 Ball');" src="https://innerjoker.github.io/" width="100%" height="100%" style="display:flex;">
  Update your browser to see this
</iframe></div>
                    
                </div>
            </div>
            </div>

am i not allowed to use this (just copied the stuff from rythm lol)

#
<div class="container is-widescreen">

            <div class="longdescription">
                <div class="content">
                    <div>
                        <iframe id="botiframe" onload="setRegularIframe('Magic 8 Ball');" src="https://innerjoker.github.io/" width="100%" height="100%" style="display:flex;">
                              Update your browser to see this
                        </iframe>
                    </div>  
                </div>
            </div>
 </div>
uncut slate
#

kill the onload

rain tulip
#

awesome

#

@uncut slate I'm having trouble loading the webpage lol

#

It just doesnt load

uncut slate
#

What's your bot's link?

rain tulip
#

Nvm, It was just a plugin - weird

#

oof its all squished

prime cliff
#

Calls it magic 8 ball

Has other commands that is not 8ball

earnest phoenix
#

xD

#

website says 100+ servers on DBL say 50 servers

solemn obsidian
#

report for fake!!!

nimble merlin
#

Hmmmm, is there a specific function in async that lets you change the bot's prefix in a specific server but nowhere else? I have the update and insert parts ready for the command I just need to know the function. (if it exists)

ruby dust
#

the only way to change a server's prefix is to store it as a data, discord.py can not be used for storing datas

earnest phoenix
#

hi

nimble merlin
#

I am storing the data in a database

earnest phoenix
#

how do u make the bot ban

#

or kick

ruby dust
#

which lib?

earnest phoenix
#

whats the script

nimble merlin
#

await client.ban(user)

#

or kick

#

brb

earnest phoenix
#

jusg put that?

ruby dust
#

what library tho?

earnest phoenix
#

idk

#

i make

#

for fun

#

only

#

xd

ruby dust
#

...

#

you have a bot dev role, and you don't know what library you used to make your bot?

earnest phoenix
#

im

#

im

#

ik

#

xd

ruby dust
#

there we go

#

idk C# tho

earnest phoenix
#

xddddddd

grizzled isle
#

Requesting Help
Language: Javascript
Libraries: Enmap, discord.js
Code:

let guilds = client.guilds.map(g => g.id)
let settings = client.settings.keyArray()
for (let i =0; i < settings.length; i++) {
      if (!settings[i].includes(guilds)) {
        client.settings.delete(settings[i])
      }
    }

What it's supposed to do: Delete all the settings that the bot is no longer in. It is in the ready event
Problem: It is not deleting anything.
Error: No errors were produced on console. Any help would help. Thanks

earnest phoenix
#

whats that

ruby dust
#

wow, this question is so well made that I want to answer but idk this language xd

earnest phoenix
grizzled isle
#

I try to be organize and straight to the point.

earnest phoenix
#

i used to use discord.js

#

but it sucks

#

@vocal hinge is my bot

grizzled isle
#

I really don't want to go to the discord.js server or the coding den as everyone eats you up like a pool of sharks prancing on one fish

ruby dust
#
await member.ban()
```that would be for discord.py, so it shouldn't be that hard with C# as well, just look at discord.net docs
grizzled isle
#

Now all of a sudden it works...

#

(╯°□°)╯︵ ┻━┻

ruby dust
#

programming can be that confusing sometimes

#

¯_(ツ)_/¯

grizzled isle
#

Ahh I put it after the client.setInterval, so after the three minutes it did it. So I just moved it above the interval

nimble merlin
#

OK, i'm back....@bot.command(pass_context=True, aliases=['PREFIX', 'Prefix']) @commands.has_permissions(administrator=True) async def prefix(ctx, *args): prefix = db['prefixes'] prefix.insert(dict(name='{}'.format(server.name), preifx='{}'.format(args))) That is my code so far....i'm just wondering how to transfer the stored data into a function that updates the prefix used in the server

ruby dust
#

I don't know how to say this, and I don't know if it's a good idea, but what you can do is to load the server prefixes in a memory, that way you'll avoid constantly spamming your database with checks if the message was a command or not

nimble merlin
#

Load the server prefix in a memory....I don't know what it is but i'll search google to find out

ruby dust
#

your system's RAM is a memory, for example

nimble merlin
#

ohhhh ok that's what you meant...right

#

So to update the prefix I need to first load the prefixes into the memory then make a check for the prefix at the beginning of every message...right...ok i'm good...thanks 😃

ruby dust
#

I'm pretty sure discord.py handles the "command or not command" check

nimble merlin
#

oh ok...thanks 😃

grizzled isle
#

Great. It did the opposite of what it was supposed to do...whiCH WAS NOT TO ERASE THE ENTIRE FLIPPING DATA

ruby dust
#

that's why you always test with a test bot first

grizzled isle
#

I did. It worked perfectly fine.

weak parrot
#

@earnest phoenix

public async Task Ban(IGuildUser user)
{
    await Context.Guild.AddBanAsync(user);
}
white blaze
#

Are channel IDs unique across Discord?

topaz fjord
#

Yes

white blaze
#

Ahh great, thanks

unborn stone
#

When you get your bot approved, can you customize the page like Tweetcord?

uncut slate
#

Yes, you can

unborn stone
#

O

uncut slate
#

well, you can already do that before approval

unborn stone
#

I don't see anything

uncut slate
#

Edit button

unborn stone
#

Like how's it's black around the edges

uncut slate
#

that's custom HTML and CSS

#

that's not included with DBL, that's something I had made myself

unborn stone
#

@uncut slate So you cannot make it own your own?

#

Is there someone I can contact?

uncut slate
#

of course you can make it on your own

unborn stone
#

Nice. 👍🏻

#

Do I send it to someone in particular?

uncut slate
#

no

#

Just edit the page.

unborn stone
#

Okay

#

But I see no option to edit the whole page.

uncut slate
#

I'm not sure what you're asking, there's a single edit button which is all you need

unique star
#

On the edit page in that lil code editor you can target the whole bot page using HTML and CSS you can even override already existing CSS Tags, hell you could even make it load your own html entirely

uncut slate
#

that last bit isn't worded too well, to be clear, you can't remove any elements from the DOM

#

full HTML+CSS is very lenient, you could just make an overlapping element if you want, which is more or less writing your own bot page from scratch

ruby dust
#

is if not guild a good enough check in discord.py to check if the command was executed in the guild or a DM?

earnest phoenix
#

can someone tell me a gud database in npm that is not enmap nor rethinkdb cause it sends errors to me

austere meadow
#

@earnest phoenix postgres is good

earnest phoenix
#

ok

#

i will try it

#

ty

austere meadow
#

👍

earnest phoenix
#

how to use thou

austere meadow
#

that's how i got started with postgres

#

even if you don't use d.js you can still adapt it to your code

earnest phoenix
#

ok

solemn obsidian
earnest phoenix
#

lol

steel tinsel
#

in discord.js, can i have multiple event of the same kind?

earnest phoenix
#

like client.on("message") @steel tinsel ?

#

having 2 of em...

steel tinsel
#

yes

earnest phoenix
#

u can hv a lot of em

steel tinsel
#

ok thanks

earnest phoenix
#

no prob

steel tinsel
#
for(var x = 0; x == client.guilds.size; x++) {
        message.channel.send(client.guilds[x].name);
      }```
#

why doesn't this word

#

*work

earnest phoenix
#

Lol because guilds is an object

#

Try mapping

steel tinsel
#

?

earnest phoenix
#

.map(g => g.name).join(", ")

steel tinsel
#

thanks

earnest phoenix
#

Np

steel tinsel
#

i'm trying to join all the servers the bot is in

#

is that possible?

earnest phoenix
#

Yes that will work, just remove g.name with g

#

You won't be able to send that in a discord message though

#

Oh

#

@steel tinsel so you want to make an invite

steel tinsel
#

i mean, enter the servers

earnest phoenix
#

Yes it's possible

#

I have a command like that

#

Just generate a invite for a channel in the guild so like !<botadmin geninv <guildId> generates an invite for the guild unless it runs into an error

steel tinsel
#

ok

earnest phoenix
#

DM me for more information

#

Basically

#

Map channel IDs

steel tinsel
#

i'm testing various things

earnest phoenix
#

And use the create invite function after you get the channel from the client and upon an error try again, but splice the old channel id out and if you keep getting Errors check for the permission to create invite for the bot

#

That's how I do mine

steel tinsel
#
      let maor = client.guilds.map(g => g.fetchInvites().code).join(", ");
      
      message.channel.send(maor);```
#

?

earnest phoenix
#

Um

#

That will work but I just create a new invite with my command

#

@steel tinsel

steel tinsel
#

doesn't work

earnest phoenix
#

Error?

solemn obsidian
#

fetchInvites is async

earnest phoenix
#

Thanks, is this discord.js?

clear hill
#

.

nimble merlin
#

Hmmmm, is there some form of format that I can use to prevent any {} or , from seperating the arguments given in my warning command (if it sounds like i'm speaking gibberish look at the image below)

idle grail
#

...

ruby dust
#

I'm more surprised on how did you even manage to do that...

idle grail
#

use .replace(\{}\g, " ");

#

ikr

nimble merlin
#

ok....thanks.. 😃

idle grail
#

OH SORRY

#

.replace(/{}/g, " ");

nimble merlin
#

Yea, you can be surprised all you want because either way....i'm a bad dev....have you not made your point clear yet?

#

aye

idle grail
#

yeah that should work correctly lol

nimble merlin
#

lol

#

Thanks 😃

idle grail
#

np

ruby dust
#

the point is, I don't even know how to do what you did

idle grail
#

exactly

#

.replace?

#

.join?

ruby dust
#

I think I know

idle grail
#

pretty sure its .join yeah

nimble merlin
#

oh...oh erm...wow..erm...I don't want to accidentally respond in the wrong way to that...lol

ruby dust
#

he is probbly joining with spaces

nimble merlin
#

yea

idle grail
#

?

nimble merlin
#

and use *args as a Key word in the command

idle grail
#

Whats the code

nimble merlin
#

that's how I did it

ruby dust
#

or ' '.split(), even better

nimble merlin
#

hold on lemme get it

#

k

idle grail
#

Lol

nimble merlin
#

embed.add_field(name='Reason:', value='{}'.join(args)) That's just the reason line of code

idle grail
#

...

ruby dust
#

wait

#

show the full command

idle grail
#

wai again

nimble merlin
#

async def warn(ctx, user: discord.Member, *args): for the KeyWords

#

k

#
             aliases=['Warn', 'WARN'])
@commands.has_permissions(kick_members=True)
async def warn(ctx, user: discord.Member, *args):
    try:
        embed = discord.Embed(title='Warning:', description='You have been given a warning in {}!'.format(ctx.message.server.name), color=0x6e7be1)
        embed.add_field(name='Server:', value='{}'.format(ctx.message.server.name))
        embed.add_field(name='Reason:', value='{}'.join(args))
        embed.add_field(name='Moderator:', value='{}'.format(ctx.message.author.name))
        embed.set_footer(text='{}'.format(ctx.message.author.name), icon_url=ctx.message.author.avatar_url)
        await bot.send_message(user, embed=embed)
    except Exception:
        await bot.say('I cannot do this. I may be unable to do this because either you or me are not permitted')```
idle grail
#

Am guessing you are not using js

nimble merlin
#

nope...Python

idle grail
#

knew it

nimble merlin
#

lol

idle grail
#

then i am no help

ruby dust
#

yep, he treats spaces as string separators with .join

nimble merlin
#

ok...thanks for trying anyway 😃

idle grail
#

Lol

#

.replace should work tho

#

try it

nimble merlin
#

ok

ruby dust
#

I'm just saying, this '{}'.format(ctx.message.author.name) can be far more simplistic

#

for example, ctx.message.author.name

#

literally

nimble merlin
#

yea....my bad

#

lol

#

I could use ID to be even more specific but oh well lol

ruby dust
#

that was probably the main reason why .join treats your spaces as separators in args

nimble merlin
#

oh ok 😃

idle grail
#

@ruby dust Whats your gender? (so i don't assume your gender and confuse everyone even more)

nimble merlin
#

value='{}'.replace(/{}/g, " ");) My guess would be that this is correct...although there is a high chance that I have goofed up lol 😄

ruby dust
#

19 year old man that has a job

idle grail
#

Lol

nimble merlin
#

cool 😃

#

no..that's not right is it

idle grail
#

12 year old newb that doesn't even get allowence

nimble merlin
#

i'm missing the args formatting 😂

#

lol

ruby dust
#

you are still overcomplicating everything

nimble merlin
#

yea

#

no surprise TBH

ruby dust
#

value=args

#

ez

nimble merlin
#

lol

ruby dust
#

I'll soon move to C#, and that means rewritting my bot from python to C# as well

#

wrong channel but whatever

nimble merlin
#

lol

#

value='{}'.replace(/{}/g, " ");.format(args)) Hmmmm...have I over complicated it?

ruby dust
#

you are using codes even beyond my knowledge, I don't even know if that is possible

nimble merlin
#

oh...ok fair enough 😃

#

Thanks for trying anyway 😃

gusty topaz
#

thats called javascript

#

and you are using regular expressions

#

and why are you putting a . after a semicolon

#

remove that semicolon else syntax error

inner jewel
#

he's using python

gusty topaz
#

no I mean

#

I mean JackTEK

#

that looks very distinctly like javascript

#

the g after regexp

#

etc

nimble merlin
#

oh ok....sorry lol

neat falcon
#

i can't find a String.prototype.startsWith anywhere

quiet bobcat
#

Do You know what caused it?

neat falcon
#

nope

ruby dust
#

how do these web devs add discord's oauth to their sites? like dbl for example

inner jewel
#

with a webserver and (discord) application clientid + secret

ruby dust
#

that did not really help

inner jewel
#

google "implementing oauth in $LANGUAGE"

ruby dust
#

k that helped, thanks

earnest phoenix
#

I'm consistently getting this error randomly while my bot is online, I have no idea why.

lavish mango
#

What's above events.js

earnest phoenix
#

Just the bot working normally

#

Please ping me if anyone replies

topaz fjord
#

What lib

#

@earnest phoenix try adding the error listener listerner

#

For d.js

earnest phoenix
#

I'm using discord.js

#

How do I do that?

topaz fjord
#
<Client>.on('error', err => { ..... })
earnest phoenix
#

So should I attempt to restart it if it runs into an error?

pastel needle
#

yes

topaz fjord
#

Yes

earnest phoenix
#

Alright.

#

Thanks for helping.

nimble merlin
#

Why TF am I unable to send that into a channel (server is owned by me)????

#

I'll just try without the role mentions

elfin hatch
#

<@&304313580025544704> When do I actually get my Bot Developer Rank?

restive silo
uncut slate
#

have a muted rank

keen anvil
#

please don't tag all mods

#

you get your bot dev role when/if your bot gets accepted

elfin hatch
#

ye sry 😅

trim plinth
#

👀

uncut slate
#

you don't even have any bots in the queue

surreal peak
#

@nimble merlin probably because it's too long

elfin hatch
#

xd

#

I'm waiting since yesterday

#

xd

uncut slate
nimble merlin
#

@surreal peak no, Clyde wouldn't respond with a message stating that the reciepnt may have blocked me blah blah blah

#

Anyway...after messing around with which role is mentioned I found a few that don't like to be mentioned lol

surreal peak
#

weird

steel heath
#

Heyo

abstract crystal
#

@ruby dust are you looking for oauth in django or sth?

earnest phoenix
#

I added a feature to my bot that generates streams of Radio New Vegas and then plays them

#

100% random, uses all the files from the game

#

there's an example of something it generated

idle mountain
#

@nimble merlin Channels (and other mentions) are looked as “#Channel” by the client but something like “<#1234567890...>” by Discord itself, meaning if you have a message that has mentions in it and is only just below the 2K character mark, the client will think it’s ok to send (and won’t give you an error for it) but Discord will see it as being over 2K characters and will give you a generic error message

nimble merlin
#

oh ok...thanks 😃

gilded blaze
#

Would it be better to store disabled commands in one value with serverdata row or make a table dedicated to it? (MySQL)

abstract crystal
#

load db into memory on bot start and do it from an array or sth

earnest phoenix
#

multiple values in 1 column = gay

#

use a dedicated table

#

disablecommand | serverid

#

select * from disabled where serverid = ?

nimble merlin
#

OK...first of all...my mind is like jelly (jello) rn, secondly, how would I make the bot collect the argument provided for this line of text (using a string breaks if for some reason): await self.bot.purge_from(ctx.message.channel, limit=something...)

#

Yea, sorry I can't figure it out myself...but like I said...my brain is like jello (or whatever americans call it) so I can't think...at all

abstract mango
#

yeah limit is supposed to be a int

abstract crystal
#

ehem

#

rEaD tHe DoCs

nimble merlin
#

hmmmm

#

maybe I can just replace the arg keyword with int....actually....I should have done the before

#

k I fixed it

daring dust
#

can someone help me with my code?

trim plinth
#

show code

daring dust
#

im trying to make an achievement command and so im trying to split the command from the argument given

trim plinth
#

ok

daring dust
#
//XBox Achievement
if (message.content.toLowerCase().startsWith("ples achievement")) {
  //let d = new Date();
  const args = message.content.slice(config.PREFIX.length).trim().split(/ +/g);
  //let mention = message.mentions.members.first();
  var loadedImage;
  let text = args[2];
    const sayMessage = args.join(" ").slice("ples achievement ").trim();//.split(/ +/g);
    jimp.read("http://lancelarsen.com/wp-content/uploads/2013/05/Achievement0-ThatConference-Blank.png")
    .then(function (image) {
        loadedImage = image;
        return jimp.loadFont(jimp.FONT_SANS_16_WHITE);
    })
    .then(function (font) {
        loadedImage.print(font, 110, 60, `${sayMessage}`)
                   .write("image4.png");
    })
    .catch(function (err) {
        console.error(err);
    });
  setTimeout(function() {
   message.channel.send("Markup image:", {
   file: "image4.png"
});
}, 1500) 
    
}
topaz fjord
#

erm

trim plinth
#

var GWmythsBlobGlare

topaz fjord
#
  1. dont autoreact
daring dust
#

?

topaz fjord
#

your auto reacting to a phrase called ples achievement

daring dust
#

ok.... so what do i do to fix dat.

topaz fjord
#

make sure all your commands start with a prefix

daring dust
#

so no hard-coding the command

#

:/

#

my prefix is ples

#

i changed it from /

trim plinth
#

hmm

gilded thunder
#

That's smart.

topaz fjord
#

ok

daring dust
topaz fjord
#

then your fine

daring dust
#

so what do i do about it :/

topaz fjord
#

whats the problem

daring dust
#

the result of this code is:

topaz fjord
#

with the code

trim plinth
#

@daring dust also don't use var unless you are using its global scope for a reason, you would rather use let or const

daring dust
#

there

#

i changed it ;-;

topaz fjord
#

wits the problem with it

daring dust
#

it includes the les achievement

topaz fjord
#

oh

#

i see

daring dust
#

yes :/

trim plinth
#

woop

daring dust
#

it only slices the p out of the image

#

just for further reference im working with an npm module called Jimp

#

but that's not the problem

unique star
#

bc thats not how slice works

#

lol

daring dust
#

oh. im stupid

#

can u help me take ples achievement out then ;-;

daring dust
#

i've seen that but..

trim plinth
#

@daring dust instead of returning the message content you would return the command args

daring dust
#

am i currently returning the args or message content?

#
//XBox Achievement
if (message.content.toLowerCase().startsWith("ples achievement")) {
  //let d = new Date();
  const args = message.content.slice(config.PREFIX.length).trim().split(/ +/g);
  //let mention = message.mentions.members.first();
  let loadedImage;
  let text = args[2];
    const sayMessage = args.join(" ").slice("ples achievement ").trim();//.split(/ +/g);
    jimp.read("http://lancelarsen.com/wp-content/uploads/2013/05/Achievement0-ThatConference-Blank.png")
    .then(function (image) {
        loadedImage = image;
        return jimp.loadFont(jimp.FONT_SANS_16_WHITE);
    })
    .then(function (font) {
        loadedImage.print(font, 110, 60, `${sayMessage}`)
                   .write("image4.png");
    })
    .catch(function (err) {
        console.error(err);
    });
  setTimeout(function() {
   message.channel.send("Markup image:", {
   file: "image4.png"
});
}, 1500) 
    
}
trim plinth
#

message content

daring dust
#

so how do i return the args?

#

i mean just like this?

trim plinth
#

hmm wai

#

t

daring dust
#
//XBox Achievement
if (message.content.toLowerCase().startsWith("ples achievement")) {
  //let d = new Date();
  const args = message.content.slice(config.PREFIX.length).trim().split(/ +/g);
  //let mention = message.mentions.members.first();
  let loadedImage;
  let text = args[2];
    const sayMessage = args.join(" ").slice("ples achievement ").trim();//.split(/ +/g);
    jimp.read("http://lancelarsen.com/wp-content/uploads/2013/05/Achievement0-ThatConference-Blank.png")
    .then(function (image) {
        loadedImage = image;
        return jimp.loadFont(jimp.FONT_SANS_16_WHITE);
    })
    .then(function (font) {
        loadedImage.print(font, 110, 60, `${text}`)
                   .write("image4.png");
    })
    .catch(function (err) {
        console.error(err);
    });
  setTimeout(function() {
   message.channel.send("Markup image:", {
   file: "image4.png"
});
}, 1500) 
    
}
#

because when i do that it only returns the first word

#

i tried doing multiple arugments of text but when they don't have a word in them they return undefined

trim plinth
#

do you know what the args declaration is even doing GWczeWhat

daring dust
#

its supposedly cutting the prefix out of the content

#

i tink

#

:/

trim plinth
#

theres more to it

#

its also splitting everything that is split by spaces into its own thing

daring dust
#

oh

#

ohhhh

#

so everything split by a space would have to have it's own argument

trim plinth
#

so lets say bad meme was sliced, bad would be args[0] and meme would be args[1]

daring dust
#

k..

#

go on :/

trim plinth
#

so lets say somebody says ples achievement meme, it would treat meme as args[2]

daring dust
#

yep

trim plinth
#

and JS starts with 0 so the first thing in a message is 0

daring dust
#

ok...

#

so how do you cut off args[0] and args[1] from the message?

trim plinth
#

thats your own can of worms

daring dust
#

;-;

#

but thats why i came here for help

trim plinth
#

ok so you would .slice(args[0])

inner jewel
#

slice(2)

trim plinth
#

that too ^

daring dust
#

so it cuts the first two arguments like this

#
//XBox Achievement
if (message.content.toLowerCase().startsWith("ples achievement")) {
  //let d = new Date();
  const args = message.content.slice(config.PREFIX.length).trim().split(/ +/g);
  //let mention = message.mentions.members.first();
  let loadedImage;
  let text = args[2];
    const sayMessage = args.join(" ").slice(2).trim();//.split(/ +/g);
    jimp.read("http://lancelarsen.com/wp-content/uploads/2013/05/Achievement0-ThatConference-Blank.png")
    .then(function (image) {
        loadedImage = image;
        return jimp.loadFont(jimp.FONT_SANS_16_WHITE);
    })
    .then(function (font) {
        loadedImage.print(font, 110, 60, `${sayMessage}`)
                   .write("image4.png");
    })
    .catch(function (err) {
        console.error(err);
    });
  setTimeout(function() {
   message.channel.send("Markup image:", {
   file: "image4.png"
});
}, 1500) 
    
}
inner jewel
#

why

daring dust
#

?

inner jewel
#

you split it, then join

daring dust
#

oh

#

like dis?

#

const sayMessage = args.slice(args[0], args[1]).join(" ").trim();

trim plinth
#

no

daring dust
#

or dis

#

const sayMessage = args.slice(args[0], args[1]).join(" ");

trim plinth
#

^

daring dust
#

oh it slices the individual characters

trim plinth
#

you would join then slice

daring dust
#

so if it increase the number 2 it'll increase the amount of characters being sliced?

#

const sayMessage = args.join(" ").slice(args[0], args[1]);

inner jewel
#

...

daring dust
#

oh

inner jewel
trim plinth
#

@daring dust hint: check out the link natan gave + slice doesn't work like that

earnest phoenix
#

finding music and moderation bots creaters tl work with me

#

im paying

#

DM Me if interested

#

i pay high

daring dust
#

i kind of understand now

trim plinth
#

@earnest phoenix #development isn't really the place to say this

earnest phoenix
#

k

daring dust
#

how's this?

#

const sayMessage = args.split(/ /g).join(" ").slice(2);

inner jewel
#

still wrong

#

you want to drop the first two arguments, not characters

daring dust
#

oh

#

it says that args.split isn't a function

unique star
#

There is a huge difference between slicing a string and an array

#

and no its not bc args is already an array lmao

daring dust
#

const sayMessage = args.split(/ /g).join(" ").slice(args[0], args[1]);

#

oh. but i'm pretty much stupid so don't expect much of me :/

inner jewel
#

...

#

did you try reading the docs i sent you?

#

or even the anidiots.guide link

#

read this

#

it explains exactly what you want to do

daring dust
#

i did read that a bunch of times but ok :/

unique star
#

read it tho dont just copy it and expect it to work

#

👀

inner jewel
#

literally what you want

daring dust
#

or this :/

#

i switched up my code a bit. now it doesn't give an error message but it also doesn't give an output :/

#
const args = message.content.slice(config.PREFIX.length).trim().split(/ +/g);
const command = args.shift().toLowerCase();
//XBox Achievement
if (command.toLowerCase().startsWith("ples achievement")) {
  let loadedImage;
  let text = args[2];
    const sayMessage = args.slice(2).join(" ");//.split(/ +/g);
    jimp.read("http://lancelarsen.com/wp-content/uploads/2013/05/Achievement0-ThatConference-Blank.png")
    .then(function (image) {
        loadedImage = image;
        return jimp.loadFont(jimp.FONT_SANS_16_WHITE);
    })
    .then(function (font) {
        loadedImage.print(font, 110, 60, `${sayMessage}`)
                   .write("image4.png");
    })
    .catch(function (err) {
        console.error(err);
    });
  setTimeout(function() {
   message.channel.send("Markup image:", {
   file: "image4.png"
});
}, 1500) 
    
}
daring dust
#

is no one going to help me?

topaz fjord
#

um

#

why are you toLowerCase(); twice

earnest phoenix
#

is there any way to ignore Bot leave messages? like when a bot leaves?

idle mountain
#

not sure what language you're using, but I'm pretty sure you could just... not add a function for that in your code? Thonkang

#

unless im misunderstanding your question but i doubt anyone else here will be able to understand it any better tbh

earnest phoenix
#

hi

#

can someone help

#

idk it puts error

#

when i make this command

#

!donate

#

it put not enough spring

#

whe

#

whelp

idle mountain
#

what language + library? also copy+paste error here (or screenshot)

earnest phoenix
#
sping(1)responce.!donate/!donationjava.https.error
idle mountain
#

....could you please take a screenshot of your error? That text is telling me almost nothing

earnest phoenix
#

ohhh fuck

#

NUUUUU

#

my vs

#

is broken

#

again

#

uh

#

i should not leave it like that

#

@idle mountain do u know how to fix

idle mountain
#

what is this a screenshot from?

earnest phoenix
#

vs

idle mountain
#

it's just microsoft having connection issues then, probably something with msdn? idk i've never seen that before

earnest phoenix
#

ohhhhhhh

#

i prefer microsoft VS

#

than the normal

#

xd

earnest phoenix
#

does anyone know if the max file size upload for a bot is 8000000 bytes or 8388608 bytes?

maiden mantle
#

discord module not found?

earnest phoenix
#

@earnest phoenix

#

mine is alot more

#

its about 12111838 bytes

#

thanks

#

the value I have, after testing is 8388353 bytes

#

using this js $eval message.channel.send({ files: [Buffer.alloc(8388353)] }) it works, but I get a discord api error if I add a single bit to that number

thin rivet
#
                        if (response.headers['x-ratelimit-remaining'] !== '0') {
                            resolve(response);
                        } else {
                            reject('You are being rate limited!');
                        }```
why this returned undefined
torpid juniper
#

in what

#

the reject

thin rivet
#

nvm

grave rune
#

any restcord users around?

solemn obsidian
#

How would I go about detecting emojis + global ones? Using eris and don't see anything related.

uncut slate
#

regex

nimble merlin
#

How could I prevent this from happening when using args, the code I have right now is embed.add_field(name='Suggestion:', value='{}'.join(args).replace('/{}/', " ")) However this fails. I am using discord.py on async btw

abstract crystal
#

just put a space instead of the {}

solemn obsidian
#

reeee

nimble merlin
#

what??? Do you mean change .replace('/{}/, " ")) to .replace('/ /, " "))?

abstract crystal
#

remove replace completely

nimble merlin
#

oh ok

#

but then it gets surrounded by paranthesis and each word is separated by a comma

abstract crystal
#

yea remove {} in "".join

nimble merlin
#

oh ok

#

it worked....thanks alot! 😃

abstract crystal
#

.join joins strings in a list separated with whatever is in that string before so:

some_list = ["Nice", "One", "LuL"]
", ".join(some_list)
>>> 'Nice, One, LuL'

or in your case it did:

some_list = ["Nice", "One", "LuL"]
"{}".join(some_list)
>>> 'Nice{}One{}LuL'
nimble merlin
#

ohhhhh, I see now lol

#

yea, thanks!

abstract crystal
#

and in replace you don't need to escape the {}

nimble merlin
#

oh ok

abstract crystal
#

only thing you'd escape in .replace would be the " or the '

nimble merlin
#

ok 😃

solemn obsidian
#

I assume no one happens to know how the url https://canary.discordapp.com/assets/15eb2b4336a23cbbfb2c7f65983674ca.svg is generated?

#

ok fuck its md5 of the image reee

bitter sundial
#

eww md5

nimble merlin
#

😄

solemn obsidian
#

idk im trying to do hacky shit to pull all possible emojis

#

except i cant get the correct hash

gusty topaz
#

go to the twemoji repo

#

lul

solemn obsidian
#

yes i exactly did that

#

unicode emoji => codepoint => read the respective emoji svg => convert to md5

#

doesn't match

#

i've found all the hashes in discord's code, but no idea how they are mapped

earnest phoenix
#

How do I make it so that people can see how many servers my bots on.....

nimble merlin
#

OK, so I want to make a giveaway function for my bot, however, I am stumped on how to select a random user from the server to win, if it helps you, here is my code so far: @commands.command(pass_context=True, aliases=['gstart', 'GSTART']) @commands.has_permissions(administrator=True) async def Gstart(self, ctx, *args): try: embed = discord.Embed(title='Giveaway:', color=0x6e7be1) embed.add_field(name='Prize:', value=' '.join(args).replace('/{}/', " ")) embed.add_field(name='Time:', value='2 Hours') await self.asyncio.sleep(432000)

#

@earnest phoenix await bot.say(str(bot.servers) <- That is for Python async BTW

earnest phoenix
#

I use discord.js

nimble merlin
#

oh, sorry then...I can't help 😢

ruby dust
#

what does code grant really do, and how useful can it be?

nimble merlin
#

I personally don't know...sorry 😄

uncut slate
#

then what's the point of answering, if you don't know just don't say anything

#

@ruby dust certain bots need a user to authorize with oauth before they're invited, that's what code grants are for

ruby dust
#

so I assume it's how @torpid cliff works? cause you can't invite that bot as easily as normal bots

uncut slate
#

yeah, for example

restive silo
#
FROM openjdk:9-jre-slim

LABEL name "Lavalink"
LABEL version "2.0.0"
LABEL maintainer "Yukine <DevYukine@gmx.de>"

WORKDIR /opt/Lavalink

RUN apt-get update \
&& apt-get install -y curl

RUN curl -o Lavalink.jar https://ci.fredboat.com/repository/download/Lavalink_Build/3112:id/Lavalink.jar?guest=1

ENV SERVER_PORT=2333 \
    SERVER_ADDRESS=0.0.0.0 \
    LAVALINK_SERVER_PASSWORD=12345 \
    LAVALINK_SERVER_WS_PORT=8080 \
    LAVALINK_SERVER_WS_HOST=0.0.0.0 \
    LAVALINK_SERVER_SOURCES_YOUTUBE=true \
    LAVALINK_SERVER_SOURCES_BANDCAMP=true \
    LAVALINK_SERVER_SOURCES_SOUNDCLOUD=true \
    LAVALINK_SERVER_SOURCES_TWITCH=true \
    LAVALINK_SERVER_SOURCES_VIMEO=true \
    LAVALINK_SERVER_SOURCES_MIXER=true \
    LAVALINK_SERVER_SOURCES_HTTP=true \
    LAVALINK_SERVER_SOURCES_LOCAL=false \
    LAVALINK_SERVER_SENTRY_DNS= \
    LAVALINK_SERVER_BUFFER_DURATION_MS=400 \
    LAVALINK_SERVER_YOUTUBE_PLAYLIST_LOAD_LIMIT=600

CMD ["java", "-jar", "-Xmx2G", "Lavalink.jar"]
``` @topaz fjord
#

teached

west current
#

It uses Discord.js

#

The current code is:

let zip = args.splice(0, 1).join().trim();
    console.log(zip.length)
    if(isNaN(zip)) {
        message.channel.send("You need to put in a zipcode that's `5` numbers long!")
    } else {
        if(zip.length >= 6) return message.channel.send("The entered zip code is over 5 numbers long!")
        const { body } = await snekfetch.get(`https://api.openweathermap.org/data/2.5/weather?zip=${zip}&appid=someStuffOut`);
        try {
            console.log(body)
        } catch(e) {
            const [information] = body.message;
            if(information === "city not found") {
                message.channel.send("Invalid zip!")
            }
        }
    }```
trim plinth
#

splice Thonk

west current
#

Shh

#

Don't judge

trim plinth
#

hmm

west current
#

Oh yea, the problem is:

(node:7160) UnhandledPromiseRejectionWarning: Error: 404 Not Found
    at _response.transport.finalizeRequest.call.then (C:\Users\Ares\Downloads\Bots\newAresBot\node_modules\snekfetch\src\index.js:195:23)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
(node:7160) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:7160) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
trim plinth
#

404 not found: not found

west current
#

When a zipcode isn't correct

#

But I thought I had that problem solved using:

const [information] = body.message;
            if(information === "city not found") {
                message.channel.send("Invalid zip!")
            }```
trim plinth
#

The easiest way to get around the issue would be using try and catch

whole parrot
#

Any One Have Special Code : js

west current
#

I do use it

#

@whole parrot What do you mean

whole parrot
#

Any Code Can Help My Bot To Be Better

trim plinth
#

sorry we don't spoonfeed, you'll have to make some code for your bot on your own

quiet bobcat
#

^

faint cedar
#

It's better for yourself to teach yourself because in the future that's gonna happen

steel tinsel
#

print('hello world')

#

^

faint cedar
#

O/

unborn stone
#
 guild.channels.get(guild.id).send({embed: {
                                ^

TypeError: Cannot read property 'send' of undefined
#

could someone help?

trim plinth
#

you need to get a guild channel, not just send to the guild with no channel to go to

#

@unborn stone

unborn stone
#

@trim plinth I have that

#

I would send you my code but I don't have it

#

just that

trim plinth
#

hmm

unborn stone
#

even if I do the ping command and it does message.send it doesn't work.

trim plinth
#

wdym "you don't have the code" Thonk

topaz fjord
#

@restive silo tank

restive silo
#

you can override the default enviroment variables with your own if you want

topaz fjord
#

back to csgo competitbe i go

restive silo
#

owo

unborn stone
#

@trim plinth I'm on my phone eyeshake

trim plinth
#

ok, makes more sense

#

well until you get the full code I can't really help you there

unborn stone
#

but no matter what I put

#

it says that error

#

@trim plinth

trim plinth
#

yeah but without the full code I can't really pinpoint the error

topaz fjord
#

@unborn stone are you trying to get a channel by server id

#

wtf

unborn stone
#

@topaz fjord I already have that set

#

whatever I say

#

it says that error

topaz fjord
#

guild.channels.get

unborn stone
#

so I need help

topaz fjord
#

find a channel with channel id

unborn stone
#

yea

topaz fjord
#

and your giving it a guild id

unborn stone
#

it's already set

#

it's saying it can't read the send property of undefined

topaz fjord
#

you do know that guild.id = the server id

nimble merlin
#

I'm curious how I would set my bot up to log a mod command with a number at the end (pretty much exactly as Luca does) and how I can add a command to edit that log (once again exactly as Luca does)

inner jewel
#

using a database

nimble merlin
#

oh....if that's the case then I might not since it seems a little time and knowledge consuming

#

if it's easy to do then I probably would but otherwise, probably not

elder rapids
#

It's really not

inner jewel
#

CREATE TABLE modlog (case_id integer primary key auto increment , message_id bigint)

#

the basic way

nimble merlin
#

is that JS?

elder rapids
#

It's as simple as storing the case number in a database

inner jewel
#

sql

nimble merlin
#

I'm using Py

#

ohhhh.....

#

I use dataset soooo

elder rapids
#

oh boy

topaz fjord
#

sql is a query lang...

elder rapids
#

^

inner jewel
#

type names might differ but you'd want 64bit number for message id

#

and 16/32bit number for case id

nimble merlin
#

aye

#

ok...i'll sort this out then

#

I'll just stick to the method that I have already....which is to require a reason on the initial mod command 😂

elder rapids
#

Not intuitive :C

nimble merlin
#

the logs are in a support server and no where else anyway so it doesn't really metter

#

wait....that discriminator is very wrong

#

I must've fucked up on the discriminator formatting then 😂

inner jewel
#
CREATE TABLE `mod_log` (
    `case_id`    INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
    `message_id`    INTEGER NOT NULL UNIQUE
);```
elder rapids
#

primary key

#

er

#

That would only work if it was for one server

inner jewel
#

ofc

elder rapids
#

(which I guess in this case it is)

nimble merlin
#

lol

elder rapids
#

Not good practice though for that

inner jewel
#

it's not that hard to change for multiple guilds

#

this is just an example

elder rapids
#

That's true 😛

restive silo
#

@inner jewel Natan that AUTOINCREMENT wouldn't work if you use that mod-log for more than 1 server eyesThink

inner jewel
#

@restive silo that's an example

restive silo
#

kk

inner jewel
#

not for copy pasting

restive silo
#

tru

nimble merlin
#

yea, my mod logs only work in my server, (the commands work in any server though) so it really doesn't matter....although when it's used outside of my server I would have to make an else statement of something like: The ban hammer has spoken...

elder rapids
#

Why not have mod logs for all servers? Thonk

nimble merlin
#

I just don't know the way to set up my database to let users set the logging channel

inner jewel
#

have an integer (in case of sqlite) field to save modlog channel id

nimble merlin
#

oh ok

#

hmmmm....this might take some thinking....back to the drawing board lol

#

actually.....it might not....

earnest phoenix
#

Hi,

That's my Sequelize model:

const Sequelize = require('sequelize');

const Database = require('../structures/PostgreSQL');

let Feedback = Database.db.define('feedback', {
    feedbackDate: Sequelize.DATE,
    userID: Sequelize.STRING,
    userName: Sequelize.STRING,
    guildID: Sequelize.STRING,
    guildName: Sequelize.STRING,
    name: Sequelize.STRING,
    content: Sequelize.STRING
});

Feedback.sync({ force: false });

Feedback.count = [];

module.exports = Feedback;

I want to get the feedback count and at every new feedback, thats make a new number.

I did something like that

const feedbackcount = await feedback.findAll();
        const count = feedbackcount.count.length + 1

But feedbackcount return to an Array with length 0.

Somebody knows what I'm doing wrong ?

abstract mango
#

that's honestly a weird indent

topaz fjord
#

oops

#

i dont think i enabled per guild case system

earnest phoenix
#

Can anyone with automatic role and checkguilds reach me specifically?

#

@abstract mango It's the copypaste thing that broke everything

abstract mango
#

ah

west current
#
(node:7516) UnhandledPromiseRejectionWarning: Error: getaddrinfo ENOTFOUND discordbots.org discordbots.org:443
    at errnoException (dns.js:50:10)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)
(node:7516) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:7516) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
rs```
#

I just changed my bot's (@supple marlin) profile picture, then that happened.

abstract mango
#

so

#

that is saying

inner jewel
#

tl;dr .catch(console.log) or something like that

abstract mango
#
(node:7516) UnhandledPromiseRejectionWarning: Error: getaddrinfo ENOTFOUND discordbots.org discordbots.org:443
    at errnoException (dns.js:50:10)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)
#

this is what you need to look at

#

and yes

#

please do use .catch

#

it should use .catch(console.error) though

slim heart
#

         go = results[0].censor
    if (go == '1') return;
    })```
It keeps saying go isn't defined, idk...
earnest phoenix
#

hmmm. i wonder why... could you be assigning something to go that is undefined? maybe check that

spring ember
#

INSERT INTO warnings (guild_id, userids, warnings) VALUES ("+guild.getId()+", {},{}); context

#

found it, it's '{}'

restive silo
#

oh

#

wait

#

isn't it "{ }"?

edgy needle
#

can someone help me make a nsfw command or hentai ( in java )

spring ember
#

nope

#

not here at least

#

@restive silo no

edgy needle
#

@spring ember do you know how do i make my bot search google for a image and then upload it?

#

not upload it but*

spring ember
#

search how to do it in google

edgy needle
#

i did

spring ember
#

use an html parser I guess

edgy needle
#

idk what that is

spring ember
#

dude this is not the place for teaching

#

learn through the internet and I will help you with every problem you encounter

#

or other people here

edgy needle
#

ok

spring ember
#

thanks for understanding

earnest phoenix
#

Hey

#

Language: C#

#

guys
for(int i = 0; i < Duplicated.Count; i++)
{
f(URLs.Contains(Duplicated[i]))
URLs.Remove(Duplicated[i]);
}
why this is doesn't remove duplicated lines

#

please help me

edgy needle
#

can someone help me

#

i have a problem

#

let msg = message.content.toUpperCase(); // This variable takes the message, and turns it all into uppercase so it isn't case sensitive.
^

ReferenceError: message is not defined

#

how do i fix it?

#

@spring ember sorry for the ping do you know how to fix it ?

spring ember
#

sorry I use java 😦

#

but I think you don't have a var named message

#

in your code

edgy needle
#

well that is java

elder rapids
#

JavaScript != Java

spring ember
#

javascript isn't java

edgy needle
#

well you said you use java

#

sorry I use java 😦
but I think you don't have a var named message
in your code

spring ember
#

you use JS

#

and I use Java

#

two different things

inner jewel
#

let msg

#

definitely not java

#

java has only var

earnest phoenix
#

can you help me please

spring ember
#

lol

earnest phoenix
#

Language: C#
for(int i = 0; i < Duplicated.Count; i++)
{
f(URLs.Contains(Duplicated[i]))
URLs.Remove(Duplicated[i]);
}
why this is doesn't remove duplicated lines

elder rapids
#

or types natan

edgy needle
#

then var?

elder rapids
#

right?

inner jewel
#

yes

spring ember
#

even var Java doesn't have

inner jewel
#

X x = new X()
var x = new X()

#

java has var

spring ember
#

nope

inner jewel
#

it has

#

JDK 10 added it

#

i can compile you a program using var right now

spring ember
#

oh right

#

but it isn't released yet isn't it

edgy needle
#

the problem is not let it is java

elder rapids
#

uhhh

#

alright then

edgy needle
#

not java i mean message*

spring ember
#

@edgy needle this is not Discord Bot List related

inner jewel
#
>type src\testing\Main.java
package testing;

public class Main {
    public static void main(String[] args) {
        var string = "hello world";
        System.out.println(string);
    }
}

>javac -d . src\testing\Main.java

>java testing.Main
hello world
#

j10 has been released

#

this month

spring ember
#

omg

#

I gotta check it out

elder rapids
#

So Java JUST now adds var

#

tbh it's not a good idea to do that

spring ember
#

why?

inner jewel
#

intellij doesn't support it yet

topaz fjord
#

seems easier

inner jewel
#

at least not on ultimate

spring ember
#

it's really pointless not to have it

elder rapids
#

var imo is a bad practice as you're not being explicit

#

It's better to be explicit about what you want

topaz fjord
#

add const and let

spring ember
#

but it is explicit

elder rapids
#

No it's not

#

var can hold anything

inner jewel
#
var x; //nope
var x = null; //nope```
#

no

elder rapids
#

A type cannot

inner jewel
#

it just infers the type

spring ember
#

but every function must specify its return type

elder rapids
#

Yeah and tbh it's better to infer the type

inner jewel
#

var x = 1;
x = "1"; //compilation error

spring ember
#

it's rly great

inner jewel
#

X x = new X(); and var x = new X(); do exactly the same

#

you can only reassign x to a valid type

spring ember
#

I am so excited

#

you made my day

inner jewel
#

java's var just infers the type, it doesn't remove it or <whatever>

spring ember
#

and it's 00:15 so

inner jewel
#

i'm against var x = y()tho

#

you need to know what y() returns to understand the code

spring ember
#

it seems like people here prefer JS though

#

and I can understand why

inner jewel
#

yes

elder rapids
#

programs C# so nty

inner jewel
#

more than half the bots here are js

spring ember
#

yeah I hate all the .NET s

#

@elder rapids killing the bots with the prefix

elder rapids
#

C# really isn't that bad XD

#

and not really killing bots at all

spring ember
#

btw don't ever do >help or !help as a joke, 20 messages on dms instantly

#

f-ing disgusting

earnest phoenix
#

var is good for long type names

bright karma
#

what does the 422 error mean? I have not changed anything on my eval command but now I get this error when ever I try to use my eval command. I really don't know what type of stuff can cause that error.

elder rapids
#
422 Unprocessable Entity

The server understands the content type of the request entity (hence a 415 Unsupported Media Type status code is inappropriate), and the syntax of the request entity is correct (thus a 400 Bad Request status code is inappropriate) but was unable to process the contained instructions.

For example, this error condition may occur if an XML request body contains well-formed (i.e., syntactically correct), but semantically erroneous, XML instructions.
bright karma
#

but weird thing is I have not changed anything in my eval command script lately

elder rapids
#

Well whatever you gave the "API" it says it's unable to process the instructions

uncut slate
#

Wondering why this isn't working like I want it to. Using Mocha + Chai.

(await REPL.execute('{ isAetheryxCool: true }'))
  .should
  .be.an('object')
  .and.equal({ isAetheryxCool: true });

Returns:

  1) execution
       simple executions
     AssertionError: expected true to be an object

Not sure why true is expected to be an Object - I just want the output to be an Object.

earnest phoenix
#

Hi,

That's my Sequelize model:

const Sequelize = require('sequelize');

const Database = require('../structures/PostgreSQL');

let Feedback = Database.db.define('feedback', {
    feedbackDate: Sequelize.DATE,
    userID: Sequelize.STRING,
    userName: Sequelize.STRING,
    guildID: Sequelize.STRING,
    guildName: Sequelize.STRING,
    name: Sequelize.STRING,
    content: Sequelize.STRING
});

Feedback.sync({ force: false });

Feedback.count = [];

module.exports = Feedback;

I want to get the feedback count and at every new feedback, thats make a new number.

I did something like that

const feedbackcount = await feedback.findAll();
        const count = feedbackcount.count.length + 1

But feedbackcount return to an Array with length 0.

Somebody knows what I'm doing wrong ?

bleak sapphire
#

can someone tell me whats wrong with this?

# Errors
@bot.event
async def on_command_error(ctx, exception):
    if isinstance(exception, commands.NoPrivateMessage):
        await bot.say('This command cannot be used in private messages.')
    elif isinstance(exception, commands.CheckFailure):
        await bot.say(noperm)
    elif isinstance(exception, commands.BotMissingPermissions):
        await bot.say("I am missing permissions :(")
#

everytime someone uses the kick command and they dont have permission this prints out in the console

Ready
ts kick @copper verge
Ignoring exception in on_command_error
Traceback (most recent call last):
  File "C:\Users\Matt GT\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\client.py", line 307, in _run_event
    yield from getattr(self, event)(*args, **kwargs)
  File "C:\Users\Matt GT\Desktop\Discord Server\Tesla\bot.py", line 57, in on_command_error
    elif isinstance(exception, commands.BotMissingPermissions):
AttributeError: module 'discord.ext.commands' has no attribute 'BotMissingPermissions'
earnest phoenix
#

Fuck

#

Sjej

#

Ee

#

We

#

Eee

#

E

#

E

#

Eee

#

Ee

#

Ee

#

Ee

#

Pau

#

Au

restive silo
#

@{GC} MagenkyouSharingan#3979 stop

idle mountain
#

he left lmao

#

???

bleak sapphire
#

pls help

idle mountain
#

with?

bleak sapphire
#

backread

hushed oyster
keen anvil
#

Doubt it, just use lowercase

hushed oyster
#

hmm

#

webhook still doesn't work

low rivet
#

code?

hushed oyster
#

but when someone upvotes

#

nothing happens

low rivet
#

code?

earnest phoenix
#

double check your codethonkku

hushed oyster
#

shit

#

leaked auth

#
@app.route('/dblwebhook', methods=['POST'])
def dblwebhook():
    if request.method == 'POST':
        if request.headers['authorization'] == 'quadruplegay':
            if int(request.values.get('bot')) == 399315651338043392:
                upvotetype = 0
                if request.values.get('type') == "upvote":
                    upvotetype = 1
                else:
                    upvotetype = 0
                # does some stuff with the data
                return "OK"
            else:
                return "no u"
        else:
            return "no u"
    else:
        return "no u"```
#

there

#

i'm using flask

bleak breach
#

sorry this might be asked all the time but I can't find it.... where can I find my DBL token?

frail kestrel
#

your bots edit page

#

dbl edit page, not discord’s

bleak breach
#

aah ok

#

so it's a different token per bot

frail kestrel
#

it’ll be at the bottom where u can either generate one or regen one

bleak breach
#

I thought it was account wide

frail kestrel
#

boof

bleak breach
#

thx

earnest phoenix
#

😣

#

ʕ•ᴥ•ʔ

earnest phoenix
#

y'all i need som help wit the mention prefix

#

aaaaaa

proven siren
#

What do you need help with?

#

I may not be of much help but I will try my best

faint cedar
#

Can't feed code but we can try

earnest phoenix
#

rip

#

spoonfeed pls spoonfeed

prime cliff
#

🤦

proven siren
#

To mention Someone, you click their name

earnest phoenix
#

sad

proven siren
#

Was that your problem @earnest phoenix?

abstract mango
#

🤦

#

that wasn't his question lol

earnest phoenix
abstract mango
#

also just to say, that's only on mobile

proven siren
#

Oh

#

I see

earnest phoenix
proven siren
#

Well I will take leave then. Best of luck to you @earnest phoenix

earnest phoenix
#

ill just quit

#

sad

#

:[

proven siren
#

No no

#

Don't

#

You can do this

#

Don't give up

earnest phoenix
proven siren
maiden mantle
#

Aye I need some help, it says "no module named discord", and I've run the pip install command and such. I dunno what to do, I'm new at this stuff.

#

^after typing a sufficient amount of code

idle mountain
#

what language+library?

abstract mango
idle mountain
#

yeah you can fix that by not using python

abstract mango
#

no u

idle mountain
#

hueheuheuhue

maiden mantle
#

Aight thanks.

quiet bobcat
idle mountain
#

i was just joking im sorry

maiden mantle
feral heath
#

Anyone know if there's any way in c# to check when you GetOrCreateDMChannelAsync(); to see if you've created the channel or got it?

hardy moon
#

Who can help me ? I would make a bot and I'm french, It's hard and the Web site is in english

gilded thunder
#

Where can I find a list of details that the discord api can get for servers and users?
Like channel count, ID, name, etc

nimble merlin
#

Hmmmm, OK....Why is this: def setup(bot): bot.add_cog(GeneralCommands(bot)) print('General is loaded') Outputting with this: file: 'file:///c%3A/Users/jackg/Desktop/My%20Bot/generalcommands.py' severity: 'Error' message: 'E0001:unexpected unindent (<string>, line 182)' at: '182,1' source: 'pylint' code: 'E0001'

frail harness
#

you know

#

i don't think you've ever heard of this

nimble merlin
#

Heard of what?

frail harness
#

but you can read the error message

nimble merlin
#

def setup(bot): is never, EVER supposed to be indented!

#

That's why.....def isn't supposed to be there

#

IDK Why or how it ended up there but oh well

#

Wait no, never mind I was thinking of something else

#

I think ik why

#

await self.bot.create_role(name='Muted', send_messages=False, color=0xFFFFFF) Hmmmm, does this work?

spring ember
#

like 100% can help you, here are JS devs mostly

nimble merlin
#

Oh....ok...well....thanks....i'll head there then

low rivet
#

what? no... @spring ember GWcfcThonk

#

this channel was never restricted to js help only

nimble merlin
#

aye....hold on

abstract mango
#

amen that there's mostly js devs that's a true fact
but that doesn't mean there isn't python peeps hanging around here

#

lol

nimble merlin
low rivet
#

full code

nimble merlin
#

^

low rivet
#

as in the whole cog

nimble merlin
#

Oh....the whole cog ok

low rivet
#

dont need to put () around class definition :p

nimble merlin
#

oh ok....lol

#

so, what is causing the command to fail?

low rivet
#

whats the error again?

nimble merlin
#

I have an exception so there is no error message unfortunately

low rivet
#

huh what?

worthy storm
#

exception = error

#

wtf

spring ember
#

yep

worthy storm
#

learn python

nimble merlin
worthy storm
#

and why are you asking for help here?

low rivet
#

^^

nimble merlin
#

Am I not allowed to request help?

spring ember
worthy storm
#

why not the discord.py server dedicated to issues using d.py that you're in

#

did they tell you to learn python?

nimble merlin
#

This isn't the JS Only Help Server

worthy storm
#

??

#

I never said it was

low rivet
#

@spring ember whats the problem with asking here?

worthy storm
#

But you should really go to d.py if you want better help

spring ember
#

d.py has more helpers

worthy storm
#

and if they tell you to learn python (im fairly sure they will), you should do it :)

low rivet
#

you dont need 500 people helping one person right?

spring ember
#

and is intended for help with exceptions

nimble merlin
#

The description of this channel is: Channel for chatting about bot developmet. If you have any questions askt the questions and wait

worthy storm
#

yes

low rivet
#

^ exactly

worthy storm
#

Im telling you

#

Youll get better help

#

In the d.py support server

spring ember
#

many people here do not use d.py

abstract mango
#

does that mean that 0 people use d.py? no

low rivet
#

but that doesnt mean nobody.. theres actually quite a few

spring ember
#

you can ask here but why?

nimble merlin
#

I'm asking wether or not I provided the right argument fileds....is that not a simple question?

low rivet
#

then why would you even ask anything?

#

@nimble merlin did u read the documentation?

spring ember
#

read the docs then

nimble merlin
#

Yes, It just mentioned: **fields

worthy storm
#

?tag lp

#

fuck

nimble merlin
#

yea, this isn't the testing channel

worthy storm
#

go to d.py and type that

spring ember
#

oh then it is most probably kwargs

nimble merlin
#

hmmmm

spring ember
#

like permissions=Permissions

nimble merlin
#

I tried hmmm

low rivet
nimble merlin
#

ok

low rivet
#

can u scroll down?

nimble merlin
#

wait nvm

#

I just saw them 😄

low rivet
nimble merlin
#

🙂

#

How would I set send messages to false if the kwarg is permissions=[]

low rivet
nimble merlin
#

Wait, so I would have to input every permission except fro send_messages???

#

Or no?

low rivet
#

discord.Permissions(send_messages=False)

#

that should work

nimble merlin
#

ah huh? ok

#

thanks