NATION

PASSWORD

FluffyCogs - a module for the Red Discord bot

Bug reports, general help, ideas for improvements, and questions about how things are meant to work.
User avatar
Darcania
Spokesperson
 
Posts: 151
Founded: Dec 29, 2014
Left-wing Utopia

Postby Darcania » Fri Oct 19, 2018 11:24 pm

With the impending update to Red V3, NationCogs has been archived and is no longer supported, though Red will still be able to install it. No further features, enhancements, or bugfixes will be added to that repo.

My repo of cogs for Red V3 may be found here: https://github.com/zephyrkul/FluffyCogs
Note that V3 cogs will not function on the old version of Red, or vice versa.

The nationstates cog there is not yet complete but the new backend I wrote for it (now entirely custom rather than using the now unsupported pynationstates) will allow me to utilize more of the API's features, so stay tuned. There were some minor changes to the commands I updated, except [p]shard, which now prints the XML directly and also accepts UNIX-style arguments to allow further tuning. For example: [p]shard --nation "Great Bights Mum" census --scale "65 66" --mode score

Future plans include porting over the rest of the commands, adding auto-role functionality based on nation, and including the two missing FT-style commands, neb and nneb, that I never finished for NationCogs. The custom asynchronous backend may also be moved to its own repo to become a separate PyPi library, but as aionationstates already exists it's unlikely I'll decide to do so.

A thread specifically for the NationStates cog in the FluffyCogs repo may or may not be made in the future depending on if I have the time and effort to spare.

Until such time as that thread exists you may continue to use this thread or TG me. Alternate contact details are in the above GitHub repo's readme.
Last edited by Darcania on Fri Oct 19, 2018 11:27 pm, edited 1 time in total.

User avatar
Darcania
Spokesperson
 
Posts: 151
Founded: Dec 29, 2014
Left-wing Utopia

Postby Darcania » Sun Oct 21, 2018 2:58 pm

LUL, not soon after the above the alpha rewrite of pynationstates is released. Oh well, I've needed to use a more async-friendly library from the start anyway.

User avatar
Darcania
Spokesperson
 
Posts: 151
Founded: Dec 29, 2014
Left-wing Utopia

Postby Darcania » Fri Jan 18, 2019 7:38 pm

Darcania wrote:The custom asynchronous backend may also be moved to its own repo to become a separate PyPi library, but as aionationstates already exists it's unlikely I'll decide to do so.

I ended up seperating this backend out to its own repo for ease of testing. It can be found on PyPI here: https://pypi.org/project/sans/
It's still in alpha (so there's likely to be plenty of bugs) and mainly used for my cogs but if anyone else is interested they can use it. Note that it's designed with concurrency (i.e. async, threads) in mind, so while it can be run synchronously in a script there's some significant overhead due to the concurrency-friendly model, so it's recommended to use Dolph's pynationstates for simple scripts.

Also, if you had my cogs downloaded on V3 before this change and are getting ImportErrors after updating, run this command: [p]pipinstall sans
(replace [p] with your prefix)
V3 doesn't record changes to a cog's requirements if the cogs were already installed, so that command will install the requirement for you.

User avatar
Darcania
Spokesperson
 
Posts: 151
Founded: Dec 29, 2014
Left-wing Utopia

Postby Darcania » Mon Jan 28, 2019 7:15 pm

Good news - Red V3 has an official, stable release now, and with my port of NSEndorse now up on FluffyCogs (my repo for V3), NS support for the latest Red is now also fully set up.

Anyone looking for a bot for their NS Discord server should now look at Red V3 rather than the old version of Red - you can find install instructions for V3 here: https://red-discordbot.readthedocs.io/en/v3-develop/

Anyone still using V2 (which you are using unless you specifically installed V3) can continue using it if they wish, but every part of it - from NationCogs, to the bot itself, to the library the bot uses to connect to Discord - are no longer actively supported beyond bugfixes for the latter two. If you haven't tried V3 before, I highly recommend it, much better than the old Red, just keep in mind that it's a brand new bot, so you'll have to install it fresh. It does support some amount of data conversion from V2, but not every cog supports that feature.

Edit: Oh, and I forgot to add that the v3 version provides links to a nation's deck and its card with the [p]nation command. Something something feature-rich upgrade.
Last edited by Darcania on Mon Jan 28, 2019 7:20 pm, edited 1 time in total.

User avatar
Johaan Christian Bach
Political Columnist
 
Posts: 2
Founded: Feb 09, 2019
Ex-Nation

Postby Johaan Christian Bach » Sun Feb 10, 2019 3:10 am

Hi, but how exactly do you download the bot?

User avatar
Darcania
Spokesperson
 
Posts: 151
Founded: Dec 29, 2014
Left-wing Utopia

Postby Darcania » Sun Feb 10, 2019 12:00 pm

Johaan Christian Bach wrote:Hi, but how exactly do you download the bot?

The instructions for doing so are linked in the post.

User avatar
Darcania
Spokesperson
 
Posts: 151
Founded: Dec 29, 2014
Left-wing Utopia

Postby Darcania » Mon Feb 18, 2019 6:29 pm

The OP has been updated with the new version of my cogs for Red V3. If you're still using Red V2 I recommend upgrading to V3 ASAP - simply updating via Red's launcher won't do it since V3 has been rewritten from the ground up and is basically a brand new bot. You can find more information in the OP.

User avatar
Darcania
Spokesperson
 
Posts: 151
Founded: Dec 29, 2014
Left-wing Utopia

Postby Darcania » Mon Oct 28, 2019 9:55 am

With the upcoming zombie apocalypse, I've added code to the nationstates cog to display statistics regarding Z-Day. The cog will automatically start displaying this information when Z-Day starts, and will automatically stop displaying this information exactly 7 days after the conclusion of Z-Day.

Remember that if you're using the old Red V2 with NationCogs, you will not get this information due to the fact that Red V2, as well as NationCogs, are EOL. Remember to upgrade to V3 whenever you can.

User avatar
Darcania
Spokesperson
 
Posts: 151
Founded: Dec 29, 2014
Left-wing Utopia

Postby Darcania » Wed Oct 30, 2019 1:27 pm

Turns out there were some minor bugs, because testing is for people who make mistakes which is clearly not me. These have been resolved, so be sure to update your cogs with [p]cog update

User avatar
Darcania
Spokesperson
 
Posts: 151
Founded: Dec 29, 2014
Left-wing Utopia

Postby Darcania » Fri Dec 13, 2019 10:31 pm

With the release of the Cards API beta, I have added in two new commands: [p]card and [p]deck. These are listed in the OP, but the relevant portions are quoted below. Feel free to give them a look!
Darcania wrote:
  1. [p]card
    Shows general information on the specified card.
  2. [p]deck
    Shows general information on the specified deck.
Last edited by Darcania on Wed Dec 25, 2019 11:20 am, edited 2 times in total.

User avatar
Darcania
Spokesperson
 
Posts: 151
Founded: Dec 29, 2014
Left-wing Utopia

Postby Darcania » Sat Feb 15, 2020 12:38 pm

Hello, everyone. This is less to do with my cogs and more to do with bots in general, but this seemed like the most appropriate place to put this.
There is a new setting going into effect from Discord soon. It restricts a lot of important information which bots use to function normally, including just having accurate info about members in a guild to determine if they can run commands.

You'll need to go here: https://discordapp.com/developers/applications and enable the related intents if you would like your bot to continue functioning as it has been. These won't be the end of the changes related to this, but it's all we have concrete info about right now from Discord.

(Image)

The main gist of the discussion regarding this change coming from Discord can be found in their announcement and in this PR thread.

In short, various functions that the vast majority of bots require to function will be whitelist-only, and you have to opt in to use these functions. Note that these changes will mean that the old version of Red (V2) will die completely soon, so if your [p]info command is still showing your discord.py version at anything less than 1.0.0 (e.g. 0.16.12), then you will need to install Red V3 ASAP. Users who are already using V3 will still need to enable these intents checkboxes if they wish their bot to continue functioning in the near future.

User avatar
August
Spokesperson
 
Posts: 135
Founded: Oct 07, 2011
Anarchy

Postby August » Sat Feb 15, 2020 1:34 pm

Saw the announcement a while back, but forgot about it. Thank you for the reminder.
|| AA Founder - Retired.

My Projects: AugustinAndroid (Server) | Augustin Alliance (Server) | NS Leaders (Server) | Tech suggestions | About me
I heard it was you / talkin' 'bout a world where all is free / it just couldn't be / and only a fool would say that...

User avatar
Darcania
Spokesperson
 
Posts: 151
Founded: Dec 29, 2014
Left-wing Utopia

Postby Darcania » Wed Jul 22, 2020 6:24 pm

If your bot is getting errors something along the lines of:
Code: Select all
TypeError: __new__() got an unexpected keyword argument 'deny_new'
or
TypeError: __new__() got an unexpected keyword argument 'allow_new'

then I'm afraid to say that the version your bot is running on is officially dead, due to a Discord API change.

If you're already running Red V3 (if your [p]info says you're running 3.X.X, you're running V3), then all you need to do is update.

If you were running Red V2 (if your [p]info states your discord.py version is 0.16.12 or less, you're running V2), then your bot's officially dead. You'll have to install Red V3, which is essentially an entirely new bot. Your data and your cogs will not be carried over.

It's worth noting that Red was not the only bot affected; some less-than-responsible bots were also killed off. My sympathies to TRR for losing their werewolf bot through no fault of their own.

I suggest you join the Red support server if you have any further questions or need further assistance with your Red bot.

Next

Advertisement

Remove ads

Return to Technical

Who is online

Users browsing this forum: No registered users

Advertisement

Remove ads