Rapptz / discord.py

An API wrapper for Discord written in Python.
http://discordpy.rtfd.org/en/latest
MIT License
14.71k stars 3.74k forks source link

authentication to discord #1195

Closed dave7280 closed 5 years ago

dave7280 commented 6 years ago

where in this library is some information how to authenticate before even using it? i'm checking examples but there's nothing about authentication, not or git page....

colcrunch commented 6 years ago

http://discordpy.readthedocs.io/en/rewrite/discord.html

IngeniousCoder commented 6 years ago
  1. Are you using ASYNC or Rewrite
  2. Please Read the docs. https://discordpy.rtfd.io
Vexs commented 6 years ago

As you haven't really gotten a good answer yet, put bluntly, we have no idea what you're asking for. What exactly are you talking about regarding "authentication"?

dave7280 commented 6 years ago

Hello again,

Sorry for missleading question. I was really confused, the entire library looks very good but i had really hard time finding how to perform authentication to discord server - i mean using this so called token. How to find it? where to put it?

At the end i managed to create new app using discord panel and get a key from there.. but there should be quick 5 point tutorial for this. Especially since i had no experience with discord but had to implement a notification using it. From my perspective it'd be great to have few words on this on git page.

dave7280 commented 6 years ago

Also the library focuses a lot on so called full-time bots. It was quite difficult to find information how to perform simple log-in and send message task... then quit. Finally i made it, but quite confusing for such simple tasks using these coroutines.

Vexs commented 6 years ago

Bot accounts aren't really for logging in and sending a single message, as you get a limited number of connects/day. It's also quite a lot of information to send/receive just for a single message. If you want that functionality, use webhooks instead, defined in the docs here. Webhooks are supported on the rewrite branch of the lib, but it's trivial to post them yourself.

It's generally assumed that you have some knowledge of how discord bots work, but the process for creating a bot account is documented on the development branch. Furthermore, the examples serve as a more than sufficient, well, example for just a basic bot.

dave7280 commented 6 years ago

Do you know what the estimated limit is for number of connects per-day?

IngeniousCoder commented 6 years ago

I’m quite sure it’s infinite

On 10 Apr 2018, at 7:11 AM, dave7280 notifications@github.com wrote:

Do you know what the estimated limit is for number of connects per-day?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

IamTails commented 6 years ago

2000 gateway conns. per 24hrs they reset your token if more , you don't need a lib for what you want, refer to the Discord doc's you can achieve what you want with a simple post request.

Vexs commented 6 years ago

All of the above is incorrect. You are limited to 1000 identify calls within a 24 hour period, across all shards. Bots with more than 100k servers receive a higher limit, but I'm unsure what it is. It's 2k

Again, connecting a bot to discord transfers quite a lot of information. Members, servers, emojis, all that jazz. I highly recommend that you just use a webhook if you're intending to stay within one channel, as it involves none of the above restrictions, doesn't require a lib, coros, or anything, just a single, basic POST request.

IngeniousCoder commented 6 years ago

I would also like to check, what is a identify call?

Does things like creating channels count? As my bot has a create channel command.

On 10 Apr 2018, at 1:13 PM, Vexs notifications@github.com wrote:

All of the above is incorrect. You are limited to 1000 identify calls within a 24 hour period, across all shards. Bots with more than 100k servers receive a higher limit, but I'm unsure what it is.

Again, connecting a bot to discord transfers quite a lot of information. Members, servers, emojis, all that jazz. I highly recommend that you just use a webhook if you're intending to stay within one channel, as it involves none of the above restrictions, doesn't require a lib, coros, or anything, just a single, basic POST request.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.