Giter Club home page Giter Club logo

jetbrains-community / discord Goto Github PK

View Code? Open in Web Editor NEW
19.0 3.0 6.0 22.38 MB

The JetBrains Community Discord Server - JetBot, the Python bot behind it

Home Page: https://jetbrains-community.github.io/discord/

License: GNU Affero General Public License v3.0

Python 88.17% HTML 11.83%
jetbrains jetbrains-ides jetbrains-community jetbrains-mps jetbrains-ui jetbrains-youtrack jetbrains-hub jetbrains-teamcity jetbrains-rider jetbrains-gogland

discord's People

Contributors

alexpl292 avatar davidcralph avatar htgazurex1212 avatar mattipv4 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

discord's Issues

Update to work with latest d.py

The bot is currently using a legacy version of the pre-release d.py rewrite that no longer exists.

It needs updating to work with the latest version of d.py. (Making it Py 3.8 compatible would be a plus too)

Sort channels alphabetically

As the title suggests, it'd be great if the bot automatically sorted the channels it creates alphabetically within each category

Add toolbox role/channel

Currently, the toolbox emoji exists in the Discord server but the role and channel for the product have not yet been created.

Add IntelliJ Edu emoji/role/channel

IntelliJ Edu edition was relased a while back, we should add the emoji/role/channel to the server.

Perhaps, the edu versions should be moved to their own category?

Server management

Currently the only server management command from the old bot that is implemented is the emoji command.
In addition, the role, channel and reactions commands need to be re-implemented in the new bot.
The role command should not check for the presence of an emoji when creating roles.
The channel command should still check for role but work without the need for the emoji to be present.
The reactions command should obviously check for emoji, role and channel.

Add PyCharm Community role/channel

The PyCharm community emoji is already added to the Discord server but currently there is no role or channel for this open-source product.

Add command to update onboarding

Once any new emoji and channels have been added, there should be a new command to update the server onboarding.

There are three questions in the server onboarding flow:

  1. Which JetBrains products are you interested in? - This has an All option with the ๐Ÿ’  emoji which unlocks the products category, and then options for every JetBrains product using the respective product emoji and unlocking the respective product channel.
  2. Which JetBrains educational tools are you interested in? - Again, with the All option and then options for each educational tool.
  3. Which JetBrains open-source projects are you interested in? - Again, with the All option and then options for each open-source project.

image

image

Employee verification ReactRole not created

When the reactions command is run in the bot, it removes all existing ReactRoles from Restarter's configuration and then adds new ones.

The current code adds all the product reactions as well as the hide channels role, but it does not include the employee verification role.

discord/bot.py

Line 732 in 5fc2a56

async def reactions(ctx: commands.Context):

The ๐Ÿ“จ emoji on the message with ID 714807760897835048 (the last message in 503862124674809866 [employee-verification-how-to, information]) should grant the role 851212921383157821 (employee verification access).

Readme

The readme currently reflects the old bot.
The readme in its current state should be copied to the old_bot folder.
A new readme can then be written reflecting the new bot with the public commands.

Add Android Studio

Android studio needs to be added to the data.json file and then the emoji/role/channel added to the server which is reliant on #2 being completed.

There is no JetBrains Community subreddit for this product currently. I plan to reach out to the existing subreddit and see fi they'd like to join :)

Post server count

As this bot is now on the majority of Discord bot lists it might be best to start posting the server count back to those lists so they and I can track how many people have invited the bot to educate themselves and their servers on JetBrains products and projects.

This is probably best done through an untracked config file that contains all the bot list auth tokens and then a module in the bot that posts the server count to https://botblock.org/ every 30 minutes. Might be best to use discordlists.py for simplicity.

Sort roles alphabetically

As the title suggests, it'd be great if the bot could automatically sort the roles it creates alphabetically. It should use the top-most role as the starting point, and sort everything below that (so that if roles get moved up the hierarchy by an admin this is preserved).

Resolve crash-loop

Feb 09 15:52:25 iona systemd[1]: Started JetBot.
Feb 09 15:52:26 iona python3[3386580]: [2024-02-09 15:52:26] [INFO    ] discord.client: logging in using static token
Feb 09 15:52:26 iona python3[3386580]: INFO:discord.client:logging in using static token
Feb 09 15:52:27 iona python3[3386580]: [2024-02-09 15:52:27] [INFO    ] discord.gateway: Shard ID None has connected to Gateway (Session ID: 3fb3e36dbf323e0055cf8a137039be4c).
Feb 09 15:52:27 iona python3[3386580]: INFO:discord.gateway:Shard ID None has connected to Gateway (Session ID: 3fb3e36dbf323e0055cf8a137039be4c).
Feb 09 15:52:27 iona python3[3386580]: Traceback (most recent call last):
Feb 09 15:52:27 iona python3[3386580]:   File "bot.py", line 587, in <module>
Feb 09 15:52:27 iona python3[3386580]:     bot.run(token[0], reconnect=False)
Feb 09 15:52:27 iona python3[3386580]:   File "/root/jetbot/venv/lib/python3.8/site-packages/discord/client.py", line 828, in run
Feb 09 15:52:27 iona python3[3386580]:     asyncio.run(runner())
Feb 09 15:52:27 iona python3[3386580]:   File "/usr/lib/python3.8/asyncio/runners.py", line 44, in run
Feb 09 15:52:27 iona python3[3386580]:     return loop.run_until_complete(main)
Feb 09 15:52:27 iona python3[3386580]:   File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
Feb 09 15:52:27 iona python3[3386580]:     return future.result()
Feb 09 15:52:27 iona python3[3386580]:   File "/root/jetbot/venv/lib/python3.8/site-packages/discord/client.py", line 817, in runner
Feb 09 15:52:27 iona python3[3386580]:     await self.start(token, reconnect=reconnect)
Feb 09 15:52:27 iona python3[3386580]:   File "/root/jetbot/venv/lib/python3.8/site-packages/discord/client.py", line 746, in start
Feb 09 15:52:27 iona python3[3386580]:     await self.connect(reconnect=reconnect)
Feb 09 15:52:27 iona python3[3386580]:   File "/root/jetbot/venv/lib/python3.8/site-packages/discord/client.py", line 627, in connect
Feb 09 15:52:27 iona python3[3386580]:     await self.ws.poll_event()
Feb 09 15:52:27 iona python3[3386580]:   File "/root/jetbot/venv/lib/python3.8/site-packages/discord/gateway.py", line 623, in poll_event
Feb 09 15:52:27 iona python3[3386580]:     await self.received_message(msg.data)
Feb 09 15:52:27 iona python3[3386580]:   File "/root/jetbot/venv/lib/python3.8/site-packages/discord/gateway.py", line 573, in received_message
Feb 09 15:52:27 iona python3[3386580]:     func(data)
Feb 09 15:52:27 iona python3[3386580]:   File "/root/jetbot/venv/lib/python3.8/site-packages/discord/state.py", line 1209, in parse_guild_create
Feb 09 15:52:27 iona python3[3386580]:     guild = self._get_create_guild(data)
Feb 09 15:52:27 iona python3[3386580]:   File "/root/jetbot/venv/lib/python3.8/site-packages/discord/state.py", line 1147, in _get_create_guild
Feb 09 15:52:27 iona python3[3386580]:     guild._from_data(data)
Feb 09 15:52:27 iona python3[3386580]:   File "/root/jetbot/venv/lib/python3.8/site-packages/discord/guild.py", line 491, in _from_data
Feb 09 15:52:27 iona python3[3386580]:     self.stickers: Tuple[GuildSticker, ...] = tuple(
Feb 09 15:52:27 iona python3[3386580]:   File "/root/jetbot/venv/lib/python3.8/site-packages/discord/guild.py", line 492, in <lambda>
Feb 09 15:52:27 iona python3[3386580]:     map(lambda d: state.store_sticker(self, d), guild.get('stickers', []))
Feb 09 15:52:27 iona python3[3386580]:   File "/root/jetbot/venv/lib/python3.8/site-packages/discord/state.py", line 379, in store_sticker
Feb 09 15:52:27 iona python3[3386580]:     self._stickers[sticker_id] = sticker = GuildSticker(state=self, data=data)
Feb 09 15:52:27 iona python3[3386580]:   File "/root/jetbot/venv/lib/python3.8/site-packages/discord/sticker.py", line 273, in __init__
Feb 09 15:52:27 iona python3[3386580]:     self._from_data(data)
Feb 09 15:52:27 iona python3[3386580]:   File "/root/jetbot/venv/lib/python3.8/site-packages/discord/sticker.py", line 416, in _from_data
Feb 09 15:52:27 iona python3[3386580]:     super()._from_data(data)
Feb 09 15:52:27 iona python3[3386580]:   File "/root/jetbot/venv/lib/python3.8/site-packages/discord/sticker.py", line 280, in _from_data
Feb 09 15:52:27 iona python3[3386580]:     self.url: str = f'{Asset.BASE}/stickers/{self.id}.{self.format.file_extension}'
Feb 09 15:52:27 iona python3[3386580]:   File "/root/jetbot/venv/lib/python3.8/site-packages/discord/enums.py", line 539, in file_extension
Feb 09 15:52:27 iona python3[3386580]:     return lookup[self]
Feb 09 15:52:27 iona python3[3386580]: KeyError: <StickerFormatType.unknown_4: 4>
Feb 09 15:52:28 iona python3[3386567]: Need to create environment: False
Feb 09 15:52:28 iona python3[3386567]: Spawning (w/ autoreboot): /root/jetbot/venv/bin/python3 bot.py
Feb 09 15:52:28 iona python3[3386567]: Bot died, restarting.
Feb 09 15:52:28 iona python3[3386567]: Bye!

I suspect the Discord.py package just needs updating, but have not confirmed.

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.