Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VxTwit] Add new cog #645

Conversation

xXJadeRabbitXx
Copy link

@xXJadeRabbitXx xXJadeRabbitXx commented May 23, 2023

Description of the changes

Adding cog fow ssue #644

Did end ;;w;; up adding nyew wibwawy URLExtwact, unsuwe walks away about impwications on depwoyment

Have the changes in this PR been tested?

Yes, manually tested with:

  • ✅ raw text message (doesn't trigger cog)
  • ✅ twitter video link message (triggers cog)
  • ✅ non-twitter link (doesn't trigger cog)

@xXJadeRabbitXx
Copy link
Author

oh and this requires the manage messages permission to edit the previous user's message, not sure if that's a problem

Copy link
Member

@Injabie3 Injabie3 left a comment

Choose a reason for hiding this comment

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

By default, by loading this cog, we will always reply on all guilds/servers. Can you please add a toggle command that checks to see if this feature is enabled on a guild, and only run your listener if it's enabled for the server?

cogs/vxtwitconverter/vxtwitconverter.py Outdated Show resolved Hide resolved
cogs/vxtwitconverter/vxtwitconverter.py Outdated Show resolved Hide resolved
cogs/vxtwitconverter/vxtwitconverter.py Outdated Show resolved Hide resolved
cogs/vxtwitconverter/vxtwitconverter.py Outdated Show resolved Hide resolved
cogs/vxtwitconverter/vxtwitconverter.py Outdated Show resolved Hide resolved
Copy link
Member

@Injabie3 Injabie3 left a comment

Choose a reason for hiding this comment

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

Aside from additional toggle to enable on a per-guild basis, changes LGTM

cogs/vxtwitconverter/vxtwitconverter.py Outdated Show resolved Hide resolved
@xXJadeRabbitXx
Copy link
Author

Aside from additional toggle to enable on a per-guild basis, changes LGTM

Can you add the guild support, I'm not sure how to do that with the configs

@Injabie3
Copy link
Member

Aside from additional toggle to enable on a per-guild basis, changes LGTM

Can you add the guild support, I'm not sure how to do that with the configs

Sure

@Injabie3 Injabie3 changed the title adding vx twit support [VxTwit] Add new cog May 27, 2023
Copy link
Member

@quachtridat quachtridat left a comment

Choose a reason for hiding this comment

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

I've left some comments.

Consider adopting camelCase to follow suit with Ren cogs code, and don't forget to adjust your PR text before merging. I get the fun but my preference is that we have fun in tests.

If you are interested in taking a step further, check https://u.sfuani.me/rencogmodel and apply the new cog model onto this VxTwit cog. Otherwise, other Rengineers (likely me) will make it happen. Reference #608 for cogs that have gone through this cog model change.

cogs/vxtwitconverter/vxtwitconverter.py Outdated Show resolved Hide resolved
cogs/vxtwitconverter/vxtwitconverter.py Outdated Show resolved Hide resolved
cogs/vxtwitconverter/vxtwitconverter.py Outdated Show resolved Hide resolved
cogs/vxtwitconverter/vxtwitconverter.py Outdated Show resolved Hide resolved
cogs/vxtwitconverter/vxtwitconverter.py Outdated Show resolved Hide resolved
cogs/vxtwitconverter/info.json Outdated Show resolved Hide resolved
cogs/vxtwitconverter/info.json Outdated Show resolved Hide resolved
cogs/vxtwitconverter/vxtwitconverter.py Outdated Show resolved Hide resolved
cogs/vxtwitconverter/__init__.py Outdated Show resolved Hide resolved
cogs/vxtwitconverter/info.json Outdated Show resolved Hide resolved
@xXJadeRabbitXx
Copy link
Author

I've left some comments.

Consider adopting camelCase to follow suit with Ren cogs code, and don't forget to adjust your PR text before merging. I get the fun but my preference is that we have fun in tests.

If you are interested in taking a step further, check https://u.sfuani.me/rencogmodel and apply the new cog model onto this VxTwit cog. Otherwise, other Rengineers (likely me) will make it happen. Reference #608 for cogs that have gone through this cog model change.

no permission to view

@quachtridat
Copy link
Member

no permission to view

Oh OK I thought at one point we made it publicly viewable 🤔
Anyway I adjusted the permission so you can view it now.

Copy link
Member

@Injabie3 Injabie3 left a comment

Choose a reason for hiding this comment

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

Tried it out on test server, needs the following changes to load the cog.

cogs/vxtwitconverter/eventHandlers.py Outdated Show resolved Hide resolved
cogs/vxtwitconverter/eventsCore.py Outdated Show resolved Hide resolved
cogs/vxtwitconverter/vxtwitconverter.py Outdated Show resolved Hide resolved
Copy link
Member

@Injabie3 Injabie3 left a comment

Choose a reason for hiding this comment

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

LGTM! Tatsu might have mentioned it, but if the embed doesn't load for the original Twitter link, then it may not perform the replacement. This happened for one of the Twitter links I posted on my test server. Re-pasting it in a new message triggered the reply. I think this is fine; can look at afterwards if we wanted to make it more robust.

@Injabie3 Injabie3 dismissed quachtridat’s stale review June 12, 2023 00:05

Non-critical changes addressed, dismissing.

@Injabie3 Injabie3 merged commit 4c51627 into SFUAnime:V3/testing Jun 12, 2023
Injabie3 added a commit to Injabie3/lui-cogs-v3 that referenced this pull request Jun 12, 2023
* adding vx twit support

* update for code cleanup

* more code cleanup

* fixes for review

* updating logger

* updates for mr

* splitting files

* updates for mr

* formatting

---------

Co-authored-by: xXJadeRabbitXx <75904609+xXJadeRabbitXx@users.noreply.github.com>
Co-authored-by: Lui <injabie3@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants