#development
1 messages · Page 738 of 1
Yes I don't have a program on python anymore so I don't really remember much
Also, I may be wrong cause again I don't know python very well so just follow the tools given to you by dbl https://top.gg/api/docs#pylib
Ok
Yeah I saw the example that example actually helped me out a lot I'm just confused on the install like dodgers use the PIP install part
Does someone know a fix or why this is happening? when I start my bot up it crashes when it logs in using the token, the error message: Error addinforole ENOTFOUND discordapp.com at getAddrInfoReqWrap.onlookup
Just thru wifi
Ye I think thats the case, I tried connecting to google and it took like 20secs lol
My wifi sucks xd
Anyway, thanks guys for the help
How frowned upon is it to ask questions about DBM here
It's not frowned upon @formal vine but don't expect help
Gotchu lol
like maybe 1 person has used it
DBM is not really coding and we're developers so the best place to look is DBM's Discord
that is active here
Is there a d.js sharding tutorial anywhere
Thank you
no problem 
in discord.js is there a way to get the User object by a users ID?
by using <Client>.users.get where <Client> is your client
ahh okay thanks a lot!
???
I had made a mistake in the embeds so
Does anyone know of a way to transfer reactions from one message to another?
I'm building a bot which has to delete a message and recreate it, and I'm trying to figure out if I can bring along the reactions with it
@earnest phoenix thats invalid code lol
@hasty bridge you cant add reactions as other users
Eh, I figured...
the best you can do is add 1 of each reaction on the message (assuming your bot can access the custom emojis used)
Mmhmm
But that wouldn't accomplish much more than just not adding the emojis in the first place 
Oh well
practically no
@mossy vine that works for me lol
@hasty bridge actually, it you are willing to put in the effort, you could render an image with the reactions and their amounts, and use it as an attachment
but knowing who were the people who originally posted those reactions is not possible with an image
is there a way to make this shorter?
define variables for the counts and write a function for handling the member object and run filter once
and try to avoid var imo
use const or let xd
and also you should use the embed builder:
new Discord.RichEmbed()
hey guys how shall i mention the command author and the avatar in the embed
if (message.content === '!embed') { const Embed = new Discord.RichEmbed() .setTitle('Test Embed') .setAuthor('Some Rome ', 'https://i.imgur.com/wSTFkRM.png', 'https://discord.js.org') .setColor('0x7289da') .setDescription('Hello this is a test embed') message.channel.sendEmbed);
then?
if you want to mention someone you could use ${message.author} and for the image you could use .setImage(message.author.avatarURL)
oh god there is so much wrong with that code
message.author.username
.setparent Isnt WOrking Discord.js
Error
TypeError: channel.setParent is not a function
channel.setParent is not a function
.setparent isnt a function in your code apparently
Stable i guess
how do you define channel
It worked When i used channel.deelte
delete*
Oh a sec My finding channel Method Is decrepted
but how do you define channel 😩
var Channel= message.guild.channels.find(c=>c.id=='644539932622323712')
Rip off of role /:
const channel = bot.getChannel(message.channel.id);
This Is what i m using
bot.getChannel 
he said he is using d.js
or just copying code
@agile idol yes
ok they're gone
🦀 s
Has anyone managed to get process.binding() working in TypeScript without using // @ts-ignore
I don't think they have Process#binding in the types
if you know what it returns, maybe add an declaration file
what if
process.binding("util") as any
thats all i know about ts :^)
and works pretty much fine for anything i do
meh
hm
This is how Process is defined in @types/node
https://gist.github.com/SinistreCyborg/0b805dee7af2ba64dc4856a063388deb#file-globals-d-ts-L828
so i tried to mimic it
@opaque eagle which version are u using for @types/node
^12.0.8
hmm
12.12+ uses declare module instead of namespaces
so i think you can do declare module 'process' and add it there
also im using node v13.2.0
does the node version and typings version have to match up
Can someone help me with this I am running this for discord bots is seeming to have a problem somewhere that I cannot figure out because it is not throwing any error code but it is also not updating on their website
def __init__(self, bot):
self.bot = bot
self.token = 'DBLtoken'
self.dblpy = dbl.Client(self.bot, self.token)
self.updating = self.bot.loop.create_task(self.update_stats())
async def update_stats(self):
while not self.bot.is_closed():
logger.info('Attempting to post server count')
try:
await self.dblpy.post_guild_count()
logger.info('Posted server count ({})'.format(self.dblpy.guild_count()))
except Exception as e:
logger.exception('Failed to post server count\n{}: {}'.format(type(e).__name__, e))
await asyncio.sleep(1800)
def setup(bot):
global logger
logger = logging.getLogger('bot')```
Are you putting that into your main file or a cog
my mane file with all the uther code
That's a code for cogs
so i need to put it in cogs
Either that or convert it to a code that can be executed in a main file
How would I transform it to work in the Main file
Or would it be easier to put in the cogs file
Does your bot use cogs
Nope
is you bot C+P
I do not even know what that is but I'm just going to transform it to work in the main file
It's really simple
The transformer for the main file
Can GitHub Actions modify my files? For example, my project is a REST API, and I want my bot to gather info on some endpoints and add it to README.md
or could it go through all my command objects and get its descriptions and put it into the readme
(command objects are in a rest api already)
@slender thistle what would need to be changed to it be convert into the main file
The init part being rewritten a bit and the references to the class
Other than that really nothing
So I just need to rewrite the reference to the class
Did you miss the init part
Well technically yeah, you won't have a class
Anything related to a class is removed when converting it to "non-class" code
def __init__(self, bot):
self.bot = bot
self.token = 'DBLtoken'
self.dblpy = dbl.Client(self.bot, self.token)
self.updating = self.bot.loop.create_task(self.update_stats())```
So basically I need to take out all that
Where are you gonna create an instance of DBLClient
So do I just take out the wine where it says class
Yes it has a reverse method
__init__ is the constructor
https://pastebin.com/WteYupAs
this returns in the console the total number of crystals for all clans put together, i dont want it like that i want total number of crystals just for 1 clan with the name of that clan so i just want it all seperate how would i do it?
@amber fractal nonono, i mean i want to find all the clans but i want the answers seperate so like this: "clanname":{"totalcrystals": 49694} for all clans so i can sort through them and make a database
make another variable (preferably using another object) to store the clan values after calculating them in your second for loop?
@fluid basin wdym expand on that, cuse sorry but i hate loops so a little explaining would be great 🥰
well you can look at line 10 from the code you sent
there is a for loop which loops through each member
so after fetching the value in the database
add it to another variable that is for the clan count
I do see that you have a map lying around at line 3, I suppose you want to use the map to store the values for each clan?
You can remove the empty exec() methods, shouldn't change anything to your code execution.
As for why it displays the total of all clans, shouldn't be very hard to understand.
You're using a nested for loop where you're looping through all members of all clans.
You simply have to reset the value each time you start looping through members of a new clan, and at the end of the members loop, you'll have the value you're looking for.
That value can then simply be stored in your Map for example
Mongo also has an $in operator which you can use in queries to check if a field contains a value in a certain array, you could use that so it would only take you 1 query to fetch all members of a clan.
why
You don't need to ping someone 3 times, or randomly ping people at all for that matter
:V
You don't need to spam
wdym how to define
Like you put def but where
its not
@late hill wait how would u use $in to get all members of a clan?
(JavaScript) Is there a one-liner to insert something to every second item of an array?
Like: ['a', 'b', 'c', 'd', 'e'] would become ['a', 'b', null, 'c', 'd', null, 'e'] for example
I'm currently doing it with a for loop, but i wonder if it can be done in one line
you can do it with a reduce
but that would be basically creating a new array
not sure how that performs against reindexing an array multiple times
Okay
Also another issue... at first the error looks dumb but why does it happen: TypeError: Cannot read property 'chunk' of undefined
https://gist.github.com/SinistreCyborg/d6346c96520d16ed8e140614ff1ffb27#file-sudoku-ts-L50
the method isn't even static or anything
okay, lots to update on
I moved the chunk function out of the class and just made it a global, standalone function
then realized it was recursive and i had no stop condition so it would reach the max call stack size
then fixed the function and now it works
Looking for help writing an ear rape detector.
my current algorithm calculates the amplitude average and the dynamic range average and attempts to use that, but either my algorithm is wrong, or that's just not a good enough measurement to detect ear rape
I did notice that my average dynamic range analysis looked like it may be promising. Yellow and Blue are human speech. Red is ear rape.
lower dynamic range = more compression = more likely to be ear rape
but I don't notice really any difference at all in the ampltiudes
(same colors)
no solid answers but it looks like it would be extremely difficult
if the earrape matched the same db as human speech it wouldn't be possible to differentiate the two since they're equally as loud
what i do notice in your first graph is how the earrape seems to fluctuate a lot less though
well I had this idea about "what is ear rape?"
loud, decibels
heavy compression
sustained over time
occurs while others are talking
i mean the red line seems to have a smaller max/min
might be easier to apply certain audio manipulations onto it to change the gain of static noises
hm?
that would just increase the amount of computation that a bot requires and probably doesn't scale well
anyone here knows haskell?
ive been wanting to learn it
someone tell me why this isnt working
<link rel="stylesheet" href="../style.css">
why is not this working
it works for paragraph only
What's the full folder outlook
is the style.css in the same folder
yes
remove ../
Clear cache? Is the button css correct?
thats all css i have
p works but class="startButton" doesnt
i also tried button {} but also doesnt
Html code, plz.
And view the source of the page, is the html page properly updated?
You didn't import the css in the html.
well i'm using vscode go live extension
i did
<link rel="stylesheet" href="style.css">
It should be in the head tag
For the button, use this:
button::-moz-focus-inner.btnBlue{ Styles go here }
button:hover.btnBlue,button:focus.btnBlue{ styles go here }
button:active.btnBlue{ Styles go here }```
alright
ok so there is probably something wrong that i wrote that i have no idea because nothing is working anymore
Screenshot?
of the html code or css?
What you changed
what i did was basically create another css file and try to put only the button in there because i am stuped
but i also tried what the dude on stackoverflow tried
Why tf would you do that
because i have absolutely no idea what is even happening anymore
it should be css .startButton button { background-color: #ffffff; }
n o t h i n g
Do inspect element
.startButton button {
font: 20px Arial;;
width: 50px;
height: 30px;
background-color: #006994
}
<button type="button" class="startButton">A</button>
ok
click the button
and?
Do inspect element, click the "select an element button", and see what it shows on styles.
good
what is even going on this is completely different than the css i put to it
it should be css button.startButton { background-color: #ffffff; }
k
As shown in the image
Overrite it
using !important
it should be css button.startButton { background-color: #ffffff; !important }
still nothing
What's your code?
and html
<!DOCTYPE html>
<html lang="en">
<script src="https://code.jquery.com/jquery-3.3.1.js"></script>
<head>
<title>thing</title>
<script></script>
<link href='style.css' rel='stylesheet'>
</head>
<body>
<canvas id="mainC" style="width: 500px; height: 300px; border: 2px solid blueviolet"></canvas>
<br>
<button type="button" class="startButton">A</button>
<p>Hello.</p>
</body>
</html>
What browser are you working? Does it work on chrome?
i'm using brave
let me test on chrome
it remains the same as brave
like,
p {} works but somehow
when i try to use any other css it doesnt
that is what i dont understand in any way possible
.
ASIODHZXUICFSUDGS
a simple semicolon
i just wasted all of your time because of me
i'm sorry
This is what I use on my website:
CSS: ``` input[type=submit], button {
background-color: #2E2E2E;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
cursor: pointer;
transition: all 0.3s ease 0s;
}```
HTML ```html
<form action=/pickchar method=post>
<input type=text name=char required>
<input type=submit value=Submit></form>
OH SHOOT
OK
I AM SOF UCING MAD
IT'S FINE
I APOLOGISE
U GUD
i also apologise for the capslock
same
debugging in css 
file = discord.File(r"C:\Users\ChillFish8\Documents\MENACE/Test1.png",
filename="Test1.png")
embed = discord.Embed(title=f"The Board", description=f"Lets get playing!", color=Colour)
embed.set_image(url="attachment://Test1.png")
await LastSentMessage.edit(file=file, embed=embed)```
so.... we have this code
and then we have the error
You got me open up sftp connections on my mobile hotspot.
Ignoring exception in on_message
Traceback (most recent call last):
File "C:\Users\ChillFish8\AppData\Roaming\Python\Python37\site-packages\discord\client.py", line 270, in _run_event
await coro(*args, **kwargs)
File "C:/Users/ChillFish8/Documents/MENACE/MENACE.py", line 61, in on_message
await Selector.Pager(message.channel, message.author.id, client, Colour)
File "C:\Users\ChillFish8\Documents\MENACE\Selector.py", line 69, in Pager
await LastSentMessage.edit(file=file, embed=embed)
File "C:\Users\ChillFish8\AppData\Roaming\Python\Python37\site-packages\discord\message.py", line 744, in edit
data = await self._state.http.edit_message(self.channel.id, self.id, **fields)
File "C:\Users\ChillFish8\AppData\Roaming\Python\Python37\site-packages\discord\http.py", line 129, in request
kwargs['data'] = utils.to_json(kwargs.pop('json'))
File "C:\Users\ChillFish8\AppData\Roaming\Python\Python37\site-packages\discord\utils.py", line 303, in to_json
return json.dumps(obj, separators=(',', ':'), ensure_ascii=True)
File "C:\Users\ChillFish8\AppData\Local\Programs\Python\Python37\lib\json\__init__.py", line 238, in dumps
**kw).encode(obj)
File "C:\Users\ChillFish8\AppData\Local\Programs\Python\Python37\lib\json\encoder.py", line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
File "C:\Users\ChillFish8\AppData\Local\Programs\Python\Python37\lib\json\encoder.py", line 257, in iterencode
return _iterencode(o, 0)
File "C:\Users\ChillFish8\AppData\Local\Programs\Python\Python37\lib\json\encoder.py", line 179, in default
raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type File is not JSON serializable
Is posting files with embeds at the same time possible, I forgot
That is what I do, atleast.
idek why
There's no formatting.
f strings is just letting the string be formatted if possible
idek why its not liking a .png
I'm looking up my code and compare it, hold on
file=discord.File(BytesIO(path), filename="hp.png"))
The f in python3.6+ is for f-strings
is innkeepers code
file = discord.File(r"C:\Users\ChillFish8\Documents\MENACE/Test1.png",
filename="Test1.png")
embed = discord.Embed(title="The Board", description="Lets get playing!", color=Colour)
embed.set_image(url="attachment://Test1.png")
await LastSentMessage.edit(file=file, embed=embed)```
is menace
It worked for me without fucking around with bytes directly
yh
Unless images are special
I don't think you can edit a file
its working for inkeeper
and no it just edits the embed
but the file can get changed
Doubtful
They don't matter
I'm using relative path and it's erroring out for me too
Have you tried opening the file, getting the bytes, and sending the bytes instead?
from io import BytesIO
both work off identical message handlers just one has a list of embeds to select from
file arg isn't mentioned in dpy docs
I usually get the bytes of a file, tbh.
I got trolled off of the discord.js server for preferring es6 over ts
from io import BytesIO
import base64
def get_bytes(path):
with open(path, "rb") as image:
x = base64.b64encode(image.read())
#or x = image.read()
return x
def get_file():
path = "source of image"
by = get_bytes(path)
file= discord.File(BytesIO(path), filename="hp.png") #Uses bytes to display images
return file
@modest maple Try this bby ❤️
Sorry, code fixed.
Hopefully, you could get the file bytes and send it like that.
it could be the file path
that's what I'm betting on
try removing the r in front, idk
@modest maple
@slender thistle's examples didn't have an r in front
its an r string
the r helps the backslashes to not fuck up
Python string formatting gang 
innkeeper has a rather big error going on rn
alrighty then
@slender thistle .format or f strings
@slender thistle hell yes (except lang files sadly)
@slender thistle lang files = dont hard code text
I HATE AJAX SO FUCKING MUCH
https://hatebin.com/coblsvggub <------- IDK if anyone wants to have a look to see if there are any places i can optimise this
current down to about 0.75s data gather time
how would I get an array of IDs of everyone in a guild
message.guild.members.array``` is weird
think its client.users that returns a list
0.75 including the loading time?
loading time is probably 90% of that, no point in optimizing lol
@empty owl you just want the ids and nothing else?
How would I set a variable to an argument? because It will repeat the role but wont save it as that https://prnt.sc/q4snbv https://prnt.sc/q4soou this last part is an error while doing my mute command it said the variable wasn't defined
discord.js
Has anyone used koa.js before for an API, and how did it go?
How do I make it so a specific server emoji shows?
Use <:name:id> u can get it from doing \:emoji:
thanks @earnest phoenix
np
no answer
check if args[1] is undefined cause you can just run the command without a second argument
What would be the lightest weight request type package (js ofc) to keep CPU and RAM percentage as low as possible for fairly rapid requests (every minute hitting several different api's)? I'm currently using node-fetch, and not sure if it's the reason why I'm hitting >100% CPU usage. Ping me for responses pl0x.
@lavish forge try to look at centra... if it seems a bit complex maybe look at phin, its a package that makes centra a bit more clean
also if you are confused that it returns a buffer just do .toString or JSON.parse
Doesnt the js error TypeError: Cannot read property '__' of undefined mean something is not defined in line before ___ ?
it means the property before __ is undefined, so yes.
damnit
now its gonna take me 5 years to find out what is undefined
const { RichEmbed } = require('discord.js');
const db = require('quick.db');
module.exports = async (client, messages) => {
const number = messages.length
const messageLogChannelVar = db.fetch(`messageLogChannel_${messages.guild.id}`)
const messageLogChannel = client.channels.get(messageLogChannelVar)
if (!messageLogChannelVar) return;
const embed = new RichEmbed()
.setAuthor('Bulk Delete')
.addField('Channel', `${messages.channel.name} (${messages.channel.id})`)
.addField('Number of Messages', `${number}`)
.setFooter(client.user.tag, client.user.avatarURL)
.setTimestamp()
.setColor('BLUE')
messageLogChannel.send(embed)
}
``` Any idea what might be defined before `id` in the messageLogVar line?
@ember atlas message isnt array and you defined number to messages.lenght.
(atleast i think)
Any idea why it would say deleted channel instead of the channel name?
I solved it, but its saying that instead of the mention
np
For a role, if I wanted to know if one specific property of it changed, how would I go about that?
Like if the color just changes, I just want that to be shown, etc
rawEvents
So I am trying to run my bot in heroku
everying goes well except when I run any command ( say .help .ping etc)
the error's are
2019-12-02T06:43:54.213245+00:00 app[worker.1]: (node:4) UnhandledPromiseRejectionWarning: ReferenceError: botconfig is not defined
now this is the code to that part
Code?
bot.on("message", async message => {
if(message.author.bot) return;
if(message.channel.type === "dm") return;
var prefixes = JSON.parse(fs.readFileSync("./prefixes.json", "utf8"));
if(!prefixes[message.guild.id]){
prefixes[message.guild.id] = {
prefixes: botconfig.prefix
};
}
lul
I know hang on got more
What kind of mistake?
want me to upload to https://codeshare.io/
since the code is over discords limit
ok hang on deploying once more just in case
I fixed it
you require botconfig?
yeah I thought I required but I accidentally uncommented
now works
🤦♀️ my bad lol
ok
in discord.js would {message}.createReactionCollector be the best way to monitor a message and whenever someone reacts with an emoji run some code?
if you want to actually get someone to react, yes, but if its to monitor alot of messages for reactions, just use the messageReactionAdd event
Doesnt this only work on fetched messages?
Quick Question How do I edit Channel Settings ERIS
wait isnt it on the docs?
it is
II literally Started it today /:
but who even reads docs before asking a question
well I read
I mean permissions /:
Eris, a NodeJS Discord library
Thanks
https://prnt.sc/q53ix4 https://prnt.sc/q53jcb Why is it saying this? I put meme(msg) but says its not read.
just ignore it
def __init__(self, x_PAT=None, y_PAT=None, name=None, title=None):
self.currentGraph = open("CURgraph", 'r')
alright
so when i try to get the string self.currentGraph elsewhere in the file, it shows it as zero-width, or the string is removed, eg when i do self.currentGraph.read()
and it reads it as ""
@opal halo show more code
whaa
you would have to find a drawing library for whatever language youre using, tint the original image pink, and put the hearts on top
im not gonna tell you how exactly to do it, figure it out yourself
yeah so use js to manipulate the image
with a drawing library
Maybe with canvas ?
Guys, tell me how to make the site display the number of servers to which my bot is connected.
CODE PLEASE
whatever your using the method toString() on is undefined
oh wait nvm that looks like an eval
or is it idk
there are 2 errors there so
i think ? nvm imma just stop talking lmao
It even tells you what is wrong
For my purge command (js & djs) how can I make it ignore pinned messages?
check if it's pinned when calling the filter method (.pinned)
and a lot of people hide it to avoid the humiliating thought of someone judging their "bad" code
idk how create a bot with python
pls help DM
step 1: learn python
you can't expect people to just give you blocks of code on demand
and yes like tim said, if you don't know python you should learn the basics
have you ever used python before?
no
😬
pls learn python
then you have to learn it first, dont jump straight into bot making
dont just try to make a discord bot and u cant even code anything
Ya python is not that hard to get into
making a bot without knowing how to use the language is like writing an essay without knowing how to read or write
not known python and jumping into discord.py is like jumping into a freight train head first
nvm 😠
it rips you up and spits you out
Cant post links?
maybe there was an invite link
and python isnt massively hard to get into
then that's why it got deleted (bot devs bypass)
Thx
- Before even attempting to create a discord bot, please learn python (?tag lp)
- To install discord.py, please run python3 -m pip install discord.py (linux), or py -3 - m pip install discord.py (windows)
... a. If you wish to use voice functionality, please use discord.py[voice] instead of discord.py - Take a look at https://github.com/Rapptz/discord.py/blob/master/examples/basic_bot.py. Mess around.
- When you start making your bot, use the commands ext: https://discordpy.readthedocs.io/en/latest/ext/commands/commands.html
- The library documentation is available at https://discordpy.readthedocs.org/en/latest/
The #help and #more-help channels in this server are related to using this library. If you want help with python questions, please ask in the python server.
If you are migrating from the old version of this library (0.16.XX; async) to version 1.XX.XX please follow the migrating guide http://discordpy.readthedocs.io/en/latest/migrating.html
Found this in discord.py server
just take that.
and add this first:
Learn the basics
Getting started
Execute Python scripts
Variables
Strings
Replace
Join
String find
Split
Random numbers
Keyboard input
Control structures
If statements
For Loops
While loop
Data and operations
Functions
List
List operations
Sort list
Range function
Dictionary
Read file
Write file
Nested loops
Slices
Multiple return
Scope
time and date
Try exception
How to use pip and pypi <---- sorta Pip more important than PyPi
OOP
Class
Constructor
Getter and setter
Modules
Inheritance
Static method
Iterable
Class method
Multiple Inheritance
they are the most basic parts you should know
thats alot of basics
And that's just the tip of the iceberg if you want to master python
most times you wont even do OOP
using oop is one thing, creating oop is another
^^
id still advise you know it
all discord libs are OOP because the discord api is OOP
fax
if you dont know what a class is or how it works you will have one hell of a bad time down the road
took me a long ass time to learn them, took me even longer before actually starting to write them
jAvAsCRiPt oOp
yes
most languages are OOP
Clojure which is a subscript of JS is a 'Fully Functional' language which has no OOP aspects
its incredibly powerful but very hard to get used to
C also doesnt have built in oop afaik
but its doable in all languages, even if in a hacky way
yh
some are Functional Types for a reason tho
and are better off left that way xD
yeah, one could say the whole concept of oop is in itself an abstraction layer / high level
yh
that is what clojure is capable of
its interesting how oop kinda was designed specifically so people could use each other's code
going from OOP to FFP is quite somthing
everything you write in oop, you write it with the intention of having other people use it
So I'm having a problem
whats up
I run the code but it doesn't say the bot is online
I'm using Node.js
whats the code?
its a lib
and it tells us its in js
im calling it a lib
its an interpreter lul
xD
and post code
more importantly post code
speak spanish?
also very relatable status
i need help in spanish
ask in #memes-and-media
does the bot come online or no?
since this is copy pasted code, the token is wrong if it doesn't come online
did you replace the token
all it says is this
did you replace the token
did you put in your OWN bot token
Yes
any help?
import discord
from discord.ext import commands
client = commands.Bot(command_prefix = '-')
@client.event
async def on_ready():
print('Bot is ready')
client.run('Token')
i put this ^^
and dont work
client.run should not go in the event
oh
it needs to be outside the function
ok
Are you getting any errors too? Just saying it does not work it not really helpful
he wont get any errors it just wont fire
the bot dont says error
cuz it wont go to on_ready

ok
@modest maple
import discord
from discord.ext import commands
client = commands.Bot(command_prefix = '-')
@client.event
async def on_ready():
print('Bot is ready')
client.run('Token')
?
:v
yh
dont work xd
error?
dont say error ;v
it should be discord.bot btw i think
rather than commands.bot
or discord.client would work aswell
ok
I am almost sure there was a way to fix the thing with the forward slashes but I don't know how to write it in Google :D
So here we go:
I have this
text = text.Replace("Starting/Maximum Cooldown Reduction", "**Starting/Maximum Cooldown Reduction**");
But this piece of code does
**Starting/**Maximum Cooldown Reduction
instead of
Starting/Maximum Cooldown Reduction
I tried doing
text = text.Replace("Starting//Maximum Cooldown Reduction", "**Starting/Maximum Cooldown Reduction**");
But then it shows as
Starting/Maximum Cooldown Reduction
what?
of python
3.8.0
visual stuido code :u ||srry for my bad english||
VSC
ok
then run your code
what's the error giving you
dont say error
whats the code again
import discord
from discord.ext import commands
client = commands.Bot(command_prefix = '-')
@client.event
async def on_ready():
print('discord.version')
client.run('token')
where :u
and the print statement
client = commands.Bot(command_prefix = '-')
"""@client.event
async def on_ready():""" <--- ignore this shit for now
print('discord.version')
client.run('token')```
ok'
chill
its just gonna send 'discord.version'

yh yh
@modest maple
if he doesnt know how functions work he needs to go back to basics
import discord
from discord.ext import commands
client = commands.Bot(command_prefix = '-')
"""@client.event
async def on_ready():""" <--- ignore this shit for now
print('discord.version')
client.run('token')
?
print(discord.__version__)
ok
how much python have you actually done
🥣
SyntaxError: EOL while scanning string literal
how much python have you actually done
none
@modest maple SyntaxError: EOL while scanning string literal
this is the person that tried to code a discord bot without python experience
ok
come back in 2 weeks
it doesnt take 1 read of a website to learn a language
also javascript is a far better language 
i have a problem
thats very subjective
im spanish :u
pretty much
nothing changes in python across languages
so legit makes no diffrence
@short siren I will DM you the code later
@modest maple work :p
What
Coolio
the bot is online xd
I'd advise you still read and practice the basics
Cuz turning the bot on is only the beginning
@short siren nvm I fixed it...
everytime I try to invite the bot to my server it says this https://prnt.sc/q5bg6y https://prnt.sc/q5bfow
how fix?
I cut off the first pic to not show my client id
Developer Application Page -> Your bot -> Bot tab (left under OAuth2) -> Disable requires code grant
ah, yes it worked thank you
client id is not sensitive information
no id is sensitive information
all ids are exposed and free to get
hi
any help
?
why this dont work?
@client.command() async def ping(ctx): await ctx.send(f'pong! (round(client.latency 1000))ms)
i do not know what to do
get rid of the extra "
embed.set_footer(text="Coded by Trock-y | Trock-y4143"")
needs to become
embed.set_footer(text="Coded by Trock-y | Trock-y4143")
@outer niche
Oof ok thx
@earnest phoenix Is there any error being output?
@outer niche EOL means you missed any of these: (),"",'',<>,[],{},etc..
if it shows that just check if there is a missing/extra one
quick question: how do i get the actual date when doing Date.now()?
what
what
you... do get it?
wdym
what
@empty owl you already get the actual date?
like in readable
message.attachments.first.url() am i using correctly
discord.js
cause when I attach a photo with the comment of 'photo' it acts like there is no photo
try it out and see
I know I already asked this before but didnt take note:
what are cheap hosting options for a bot?
@tacit stag digital ocean with github student
u get credit
@sudden geyser its not working
url isnt a function
but i tried url plain out and it doesnt work either
Look in the Discord.js docs for Message#attachments
yea
You'll see a first property that's a function, so call first() like a function instead of url() as it's not one
https://discordapp.com/channels/264445053596991498/272764566411149314/576818380498010112 @tacit stag You can also refer to this
thanks @slender thistle
im back
let person = message.mentions.members.first();
let name = args[1]
if (!person || !name) return message.reply('Missing Args... Usage: !accept <ping> <name>')
let mod = message.guild.roles.find(val => val.name === 'Mod');
let admin = message.guild.roles.find(val => val.name === 'Admin')
let owner = message.guild.roles.find(val => val.name === 'Owner')
let role = message.guild.roles.find(val => val.name === 'Student')
if (message.member.roles.has(mod.id) || message.member.roles.has(admin.id)) {
person.setNickname(name)
person.send('Verified.')
person.addRole(role.id)
message.channel.send("Success!")
} else {
message.channel.send("**Restricted Access**")
}
says Cannot execute action on a dm
but this isnt in a dm
soo
also the nickname change and role add arent working
nvm the role is workng but nickname isnt
Are you sure the error's from that snippet of code? I'd assume it would have throw a TypeError if it was from a DM.
yea
@earnest phoenix EOL means you on missing or have too many of these: (),"",'',<>,[],{},etc.
aka a missed apostrophe there as well as curved brackets in this case
If you don't want to further format the response, tbh just send the integer returned by round
await sondageMessage.add_reaction(":thumbsup:")
await sondageMessage.add_reaction(":thumbsdown:")```
Is there something wrong with this because I cannot get it to do reactions
\👍
\👎
smfh
how would I get my bot to change his activity every 6 hours in discord.js?
setInterval
Hey. I'm trying to make a bot using Regular Python (Without the Discord Python Extention thing) and I need some help.
1) I can't get images to work, even with the Pillow Extension
2) I don't know how to make text Bold or coloured
Note: I am using Windows 10
oh
Where are you trying to send images to?
Not trying to send them.....trying to make them appear in the code:
Eg:
img = <image of Charizard>
print (img)```
The output will give me the image inside the module (the thing that shows the output of your code)
I'm using IDLEpython
3.8
Windows
oh so this is just python help
https://discord.gg/programming is what you need
fuck
yeppers
thats it
Um, I wanna create a dashboard like letting users login with their discord in my site and all the things they do there would be saved in bot like changing prefix. But I don't have any idea on how to transfer the prefix from site to bot. Can anyone help me?
@trail verge idk if you still need help with the python stuff but, as far as I'm aware you cannot 'print' a image you load up in python in the IDE mostly because when you open a file it just takes the actual content of the file
If you want to show files on screen you'll need some sort of module to create a application
Like wxpython, tkinkers, etc... Or pygame
obviously pygame is mentioned
Because we all know pygame is the superior way to make an application in python xD
client.on('ready', () => {
console.log('Les logs de vitas')
});
client.on('message', message => {
if (message.content === prefix +'logs' ) {
const logembed = new RichEmbed()
.setColor('#679ec5')
.setTitle(`**Voulez-vous créez le salon ${Vitas} ?**`)
.then(() =>
message.react(':white_check_mark:' ))
.then(() =>
message.react(':x:'))
if(message.react === ':white_check_mark:')
guild.createChannel('logs-vitas', {type: text})
.then(console.log)
.catch(console.error);
}})```

at Client.client.on.message (c:\Users\hieli\Desktop\Vitas\node_modules\index.js:210:4)
at Client.emit (events.js:203:15)
at MessageCreateHandler.handle (c:\Users\hieli\Desktop\Vitas\node_modules\dis```
Apart from that whole client.cleint stuff
You will also probably crash with the reactions btw
Cuz :X: doesn't work for discord bots
Orwhite_check_mark
ouh ok
Is there a way to redirect traffic from
subdomain.mywebsite.com:80
to
somehost.com:2378
using a CNAME (if you're using Cloudflare/GitHub pages)
ehh nope I doubt a CNAME will work
were using namecheap

unless the url is something like subdomain.mywebsite.com:2378
then you can use CNAME
you could just have a proxy for that
reverse proxy
on apache2?
if you can configure your server settings
yeah
possible
but the only problem with that is you need to deal with the IP and stuff
since if you directly get the IP of the client it will be the proxy server and not the real IP
.
we tried with this .htaccess file but we kept getting server 500 error
ServerName subdomain.mywebsite.com
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / somehost.com:2378/
ProxyPassReverse / somehost.com:2378 /
<Location />
Order allow,deny
Allow from all
</Location>
</VirtualHost>```
ehh
with the host domains and the domain being our own
you have to change your site configuration
not access configuration
.htaccess is access configuration
where do you do that on namecheap
yeah which is why it isn't really possible
I mean
unless you have a vps lying around
you will need to change apache config which is located in the installation directory of apache
where is somehost.com hosted? you can reverse proxy from somehost:80 to somehost:2378
you can also try messing around with SRV records
await sondageMessage.add_reaction("👎")```
Is there something wrong with this because I cannot get it to work
@quartz kindle somehost is basically the hosting, its on pterodactyl
i have a sample http server running on it to test if its working
and we have no clue how to reverse proxy without changing the apache root config (which we cant)
and we tried with srv but we're unsure of what to put
This is the error it keeps on giving me Yes I am on my phone
The english couldn't be more plain.
I don't use python, but you have an unexpected indent.
@outer niche read the error
if/else/function:
print('correct indent')
print('this line will give errors because wrongly indented')```
@outer niche
Basic python teaching
i get error 403 on my website (other browser°
Are there any ratelimits on @me (accessed with a bearer token from oauth2)
im working on discord sign in and just making sure if i can call it to get the username/guilds as much as i want without getting ratelimited
I'm not entirely sure, but I would say there's a very high probability that there is
q
this is not vim
every endpoint has a ratelimit
:v
async def ping(ctx):
await ctx.send('Pong!')```
what branch are you using
you mean the app?
whats the best way of implementing things like patreon and nitro boosting into an api for premium users? Atm i use roles that they get and add it up but i've a feeling this isn't the best option
@modest maple Ok ||;u||
cant do much for nitro boosting though
since the only way to find out is through the booster role
@slim heart can't view nitro boosting by event, but you can create a webhook server for Patreon
Does anyone here know how to do a linter if so I need help cause I've tried to do it but I can't
just.. install one?
I can't the computer I use has almost no space and it's a piece of s***
👏 What 👏 language 👏 are 👏 you 👏 using👏
Node.js


