Skip to content
This repository has been archived by the owner on Dec 26, 2022. It is now read-only.

✨ ⚡ Added Mentionable type and improved Interaction performance #253

Merged
merged 11 commits into from
Nov 28, 2021

Conversation

Lunarmagpie
Copy link
Member

@Lunarmagpie Lunarmagpie commented Nov 25, 2021

Changes

  • adds: Mentionable type is now a thing, Merges User and GuildMember to make some stuff easier.
  • improvements: Interactions no longer make excess calls to the discord API

Check off the following

  • I have tested my changes with the current requirements
  • My Code follows the pep8 code style.

@codecov
Copy link

codecov bot commented Nov 25, 2021

Codecov Report

Merging #253 (7240046) into main (a864624) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #253   +/-   ##
=======================================
  Coverage   90.00%   90.00%           
=======================================
  Files           9        9           
  Lines         100      100           
=======================================
  Hits           90       90           
  Misses         10       10           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2a5757a...7240046. Read the comment docs.

@Lunarmagpie
Copy link
Member Author

Parts of the diff look wrong. Will reopen once I fix that.

@Lunarmagpie Lunarmagpie reopened this Nov 26, 2021
@Lunarmagpie
Copy link
Member Author

Lunarmagpie commented Nov 26, 2021

Looks pretty good now. Im not sure about my if/else tower but I don't know what to replace it with, dict wouldn't work great here.

@Lunarmagpie Lunarmagpie force-pushed the mentionable branch 2 times, most recently from 19d77c4 to c4e6304 Compare November 26, 2021 01:54
pincer/objects/guild/member.py Outdated Show resolved Hide resolved
from the discord API.
for option in self.data.options:

if option.type is AppCommandOptionType.STRING:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this big elif chain is actually any faster?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea. It's there now since Mentionable runs two different functions so a dictionary doesn't work.
The optimazatiom comes from me removing unnecessary request to the discord API.

@Lunarmagpie Lunarmagpie merged commit 9959da3 into Pincer-org:main Nov 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants