Open Menu
AllLocalCommunitiesAbout
lotide
AllLocalCommunitiesAbout
Login

The Legends is among us

⁨436⁩ ⁨likes⁩

Submitted ⁨⁨22⁩ ⁨hours⁩ ago⁩ by ⁨Stamets@lemmy.world⁩ to ⁨[deleted]⁩

https://lemmy.world/pictrs/image/62b784c4-6b13-46f8-acb1-2548bcd02fd2.png

source

Comments

Sort:hotnewtop
  • Ghostalmedia@lemmy.world ⁨21⁩ ⁨hours⁩ ago

    Needs smaller blurrier code. I can still read half of it.

    source
    • sjmarf@sh.itjust.works ⁨19⁩ ⁨hours⁩ ago

      For your viewing pleasure:

      for entry in entries:
          if entry['time'] + 1800 < time():
              guild = self._bot.get_guild(int(entry['guild_id']))
              member = guild.get_member(int(entry['user_id']))
              if member is not None:
                  if member.activity.name is not None:
                      if member.activity.name.lower() == "league of legends":
                          await member.send("The 30 minutes has elapsed and you are still playing league, get banned.")
                          await member.ban(delete_message_days=0, reason='playing league')
      
      source
      • Ghostalmedia@lemmy.world ⁨18⁩ ⁨hours⁩ ago

        Bruh. I said I wanted it worse.

        source
        • -> View More Comments
  • M137@lemmy.world ⁨4⁩ ⁨hours⁩ ago

    Should be: if you play LoL at all you get banned.

    source
  • Pnut@lemm.ee ⁨15⁩ ⁨hours⁩ ago

    I had a roomie that played lol. After a month of not having a job and looking very scruffy he emerged from his filthy bedroom and gave me a grocery list. We were on good terms until I told him he had an addiction.

    source
  • capuccino@lemmy.world ⁨20⁩ ⁨hours⁩ ago

    lmao discord bots can be that intrusive?

    source
    • Cenotaph@mander.xyz ⁨20⁩ ⁨hours⁩ ago

      Discord has a feature that broadcasts games you play to your friends at all times, and many people leave the feature on.

      source
      • Nindelofocho@lemmy.world ⁨39⁩ ⁨minutes⁩ ago

        I think its called Discord Rich Presence? If anyone is looking to turn it off. I think you can turn it off for specific games too

        source
      • interdimensionalmeme@lemmy.ml ⁨11⁩ ⁨hours⁩ ago

        I would not even let other user even know my username.

        source
    • TheSambassador@lemmy.world ⁨17⁩ ⁨hours⁩ ago

      If the server owner gives the bot access to those permissions and the users have activity sharing enabled, yep.

      source
  • ceenote@lemmy.world ⁨20⁩ ⁨hours⁩ ago

    30 minutes? Seems lenient. Can discord detect if League is installed?

    source
    • pineapplelover@lemm.ee ⁨20⁩ ⁨hours⁩ ago

      No but maybe it can detect if >0 minutes are played or if there’s a Riot Games account installed (but this would also ban valorant players)

      source
      • msage@programming.dev ⁨19⁩ ⁨hours⁩ ago

        this would also ban valorant players

        Good.

        source
        • -> View More Comments
      • RandomVideos@programming.dev ⁨5⁩ ⁨hours⁩ ago

        if theres a Riot Games account installed

        How?

        source
    • arudesalad@sh.itjust.works ⁨17⁩ ⁨hours⁩ ago

      It can but I think it’s only client side (for their buggy overlay). Not something bots can access

      source
  • underscores@lemmy.zip ⁨19⁩ ⁨hours⁩ ago

    nested lonely ifs?

    someone execute this man at once

    source
    • Jankatarch@lemmy.world ⁨16⁩ ⁨hours⁩ ago

      There are two types of programmers.

      // comment1
      if(condition1) {
        // comment2
        if(condition2) {
          // comment3
          if(condition3) {
            printf("hello, world\n");
          }
        }
      }
      

      and

      // comment1
      if(!condition!) {
        return;
      }
      
      // comment2
      if(!condition2) {
        return;
      }
      
      // comment3
      if(!condition3) {
        return;
      }
      
      printf("hello, world\n");
      
      source
      • rothaine@lemm.ee ⁨15⁩ ⁨hours⁩ ago
        if (condition && condition1 && condition2)
        
        source
        • -> View More Comments
      • ICastFist@programming.dev ⁨15⁩ ⁨hours⁩ ago
        // comment
        if(x < 10) {
          // comment1
          if(x < 20) {
            // comment2
            if(x < 30) {
              printf("hello, world\\n");
            }
          }
        }
        
        source
        • -> View More Comments
      • undefined@lemmy.hogru.ch ⁨12⁩ ⁨hours⁩ ago

        I’m so the latter. The former drives me fucking crazy.

        source
      • interdimensionalmeme@lemmy.ml ⁨11⁩ ⁨hours⁩ ago
        if(!condition) {  return;}: If(!condition1) {return;}; if(!condition2) {return;}; 
        
        source
    • REDACTED@infosec.pub ⁨6⁩ ⁨hours⁩ ago

      Correct me if I’m wrong, but the script works faster with nested IFs since if it fails at the first one, it won’t bother reading next ones, unless you kill/return from function.

      All in all, this feels like readibility argument, not correctness or efficienty argument

      source
  • Dicska@lemmy.world ⁨17⁩ ⁨hours⁩ ago

    It’s especially spicy when you consider that one single normal League match can easily extend beyond 30 minutes. Hell, even a lighter mode (ARAM) can be 30-35+ minutes at times.

    source
  • IDew@lemm.ee ⁨22⁩ ⁨hours⁩ ago

    AMONG US

    source
  • NONE_dc@lemmy.world ⁨20⁩ ⁨hours⁩ ago

    Is that GDScript (Godot Engine) or Python?

    source
    • RandomVideos@programming.dev ⁨5⁩ ⁨hours⁩ ago

      Unless you are using gdscript in a different code editor than godot, it would look different

      source
    • felsiq@lemmy.zip ⁨20⁩ ⁨hours⁩ ago

      It seems to match the discord bot api from python and that’d be a more logical choice for a bot lol

      source
      • NONE_dc@lemmy.world ⁨18⁩ ⁨hours⁩ ago

        That bot can recognize GDScript? Or can confuse it with Python? (Since both languages are very similar in some respects)

        source
        • -> View More Comments
    • OsrsNeedsF2P@lemmy.ml ⁨19⁩ ⁨hours⁩ ago

      GDScript is heavily inspired by Python’s syntax, but has a few differences with typing and string formatting. This code is Python but tbh would probably run on Godot

      source
    • CommanderCloon@lemmy.ml ⁨19⁩ ⁨hours⁩ ago

      GDScript really does read like Python haha

      source