Coder Social home page Coder Social logo

invites's Introduction

Invites

What is Invites? What does it do?

Invites is a small, easy to use cog for tracking which invites joining members use! It relies on a number of attributes added to your Bot for convenience as well as on_invite_update - a new, custom event that is dispatched

  • Upon loading, assigns Bot.invites, Bot.expiring_invites, Bot.shortest_invite, Bot.last_update, Bot.get_invite() and Bot.wait_for_invites()

    • This is noted to reduce conflicts for developers utilising bot variables
  • Requirements

    • discord.py 1.5.0+
    • GUILDS, SERVER_MEMBERS and INVITES intents
    • manage_guild and manage_channels permissions

How do I use this?

The recommended method is to follow the instructions below to plug and load the cog into your bot, then in another cog/file you listen to on_invite_update and manipulate the resources given to you. The event grants access to 2 parameters: the Member that was invited and the Invite that was assumedly used, example here.

  1. Click on invites.py in the repository's file directory

Screenshot

  1. Right-click the "Raw" button and click the "Save link as..." option

Screenshot

  1. Save it within your cogs directory or wherever you store/load your cogs

Screenshot

  1. Code away using the newly implemented features!

NOTE: REMEMBER TO LOAD THE COG TO BE ABLE TO USE IT'S FEATURES

There is a problem with this, how can I report it?

There are two ways to report a problem:

  1. Create an issue for this repository.
  2. Ping me in the Discord.py server (Cyrus - <@668906205799907348>)

I (Cyrus) personally prefer and recommend the former but if I am around in #help or #testing then feel free to ping me in those respective channels.

Is there any way for me to contribute?

Thank you in advance if you do choose to contribute - I am open to constructive criticism and will happily review any PRs sent to this repo!

Credits

Thanks to Maya for being the initial contributor to this idea I had in mind, this repo would not be here without your ideas and expertise! <3 Huge thanks to "Dog" for contributing so many improvements and optimisations, this repo is only growing thanks to you! :)

invites's People

Contributors

cyrus01337 avatar mysistersbrother avatar mrreacher avatar xuathegrate avatar helish88 avatar

Stargazers

 avatar Mark avatar Kurniawan Fitriadi avatar waeez avatar Erik avatar  avatar Hunter avatar Honza Javorek avatar  avatar ZingyAwesome avatar  avatar hysse avatar  avatar Ghoul avatar  avatar

Watchers

 avatar  avatar

invites's Issues

Wrong Member Given As Inviter

What Were You Trying To Do?

I am using a slightly modified version of this cog: Removed some methods and listeners, made it to only work on a specific guild.
Here is what I'm using: https://hastebin.com/wetaginajo.py

What Is The Problem?

Wrong member given as inviter.

How Did You Come Across This?

1
2
3

What Version Of Discord.py Do You Have?

1.5.1 all intents except presences

Vanity URL

What Is The Problem?

When someone joins with a vanity URL the event is not triggered

How Did You Come Across This?

Get an alt, join with a vanity url and the event will not trigger

What Version Of Discord.py Do You Have?

1.6

CPU Usage Issue

What Were You Trying To Do?

I noticed that after the update to fix expiring invites, this cog now spikes the cpu to 100% whenever it is active.

What Is The Problem?

The cpu spikes to 100% CPU for as long as the cog is loaded. When I unload it, the CPU usage falls back to normal values. This only happens on linux for some reason and I have no idea why. I am guessing there is some inefficiency in the code.

How Did You Come Across This?

  1. Load the cog
  2. CPU spikes to 100%
  3. Unload the cog
  4. CPU usage normalises

What Version Of Discord.py Do You Have?

1.6 with all intents

Event Not Firing Sometimes

What Were You Trying To Do?

I invited my alt using a newly generated link. The invite update event never fired. This has happened a few times before. I rejoined the server with my alt and the event still did not fire.

What Is The Problem?

The on_invite_update does not fire sometimes.

How Did You Come Across This?

  1. Generate a new invite link
  2. Invite somebody
  3. The invite_update event may not fire

What Version Of Discord.py Do You Have?

1.6 with all intents enabled

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.