'MongoDB encryption and description

I want to encrypt some user important fields in user collection but I don't want the server should take care of encryption or decryption, I want MongoDB to encrypt data by itself and decrypt by itself server should just trigger normal query like find or insert.

While insert query mongoDB should encrypt that particular field's data and when i trigger find query mongoDB should decrypt data and send back to server



Solution 1:[1]

nextcord doc

you need to use:

entity_type = nextcord.ScheduledEventEntityType.external

also:

  • channel needs to be a voice_channel
  • all args are required
  • start_time needs to be in the future
  • for start_time & end_time use timezone.utc

Type.external snippet

@client.command()
async def rp(ctx):
    now = datetime.now(timezone.utc) + timedelta(seconds=10)
    tomorrow = now + timedelta(days=1)
    await ctx.guild.create_scheduled_event(
        name="roleplay-sessions",
        privacy_level = nextcord.ScheduledEventPrivacyLevel.guild_only, # optional
        metadata = nextcord.EntityMetadata(location='roleplay-sessions'),
        start_time = now,
        end_time = tomorrow,
        description = 'lorem ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod tempor incididunt ut labore et.',
        entity_type = nextcord.ScheduledEventEntityType.external
        )

Type.voice snippet

@client.command()
async def rp(ctx):
    channel = ctx.guild.get_channel(int(CHANNEL_ID)) # voice_channel
    now = datetime.now(timezone.utc) + timedelta(seconds=10)
    await ctx.guild.create_scheduled_event(
        name="roleplay-sessions",
        channel = channel,
        privacy_level = nextcord.ScheduledEventPrivacyLevel.guild_only, # optional
        start_time = now,
        description = 'lorem ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod tempor incididunt ut labore et.',
        entity_type = nextcord.ScheduledEventEntityType.voice
        )

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1