1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Tweet Plugin

Discussion in 'Requests' started by Daniel23, Jun 15, 2017.

  1. Daniel23

    Daniel23 Witch

    Messages:
    58
    GitHub:
    daniel23
    Is there a plugin where if you /tweet[Number] will automatically tweet on your Twitter account while in the game??
     
  2. Thunder33345

    Thunder33345 Chicken Verified

    Messages:
    1,781
    GitHub:
    Thunder33345
    please dont be shallow, give us all the details, everything you can think of...
    do you want it to just tweet random things while you are in game? or your all of your actions? or whatever you typed in chat?
    what does [number] meant, do you want it to stay enabled after number of relogs? max numbers of tweets? or what?
    if you want a plugin that works like how you envisioned it, please tell us how you want it to be, we cant read your minds and you cant expect someone to make something for you the way you wanted it to be without telling them how
     
  3. Daniel23

    Daniel23 Witch

    Messages:
    58
    GitHub:
    daniel23
    [Number]
    1:Hello Twitter
    2: Join
    and so on

    You can add it on the number that represents what you're going to tweet where you can edit on the Plugin.yml

    If I were to start a UhC and wanted to say that you can now join,server is unwl-ed ...
     
  4. HimbeersaftLP

    HimbeersaftLP Wither Skeleton

    Messages:
    1,241
    GitHub:
    HimbeersaftLP
    I'm quiet sure you mean config.yml :D
     
  5. WinterBuild7074

    WinterBuild7074 Zombie Pigman

    Messages:
    700
    GitHub:
    winterbuild7074
    If you know how to code, use this code:
    PHP:
    public function onCommand(CommandSender $senderCommand $cmd$label, array $args) {
        if(
    $cmd->getName() === "tweet") {
            
    $message1 $this->getConfig()->get("Message-1");
            
    $message1 $this->getConfig()->get("Message-2");
            
    $message1 $this->getConfig()->get("Message-2");
            if(isset(
    $args[0])) {
                    switch(
    $args[0]) {
                        case 
    "1":
                            
    $sender->getLevel()->getServer()->broadcastMessage($message1);
                            break;
                        case 
    "2":
                            
    $sender->getLevel()->getServer()->broadcastMessage($message2);
                            break;
                        case 
    "3":
                            
    $sender->getLevel()->getServer()->broadcastMessage($message3);
                            break;
                        default:
                            
    $sender->getLevel()->getServer()->broadcastMessage("§cThat Tweet ID cannot be found!");
                            break;
                    }
            } else {
                
    $sender->sendMessage("§cPlease enter a Tweet message ID!");
            }
        }
    }
     
  6. Thouv

    Thouv Slime

    Messages:
    85
    I think they mean it sends the tweet on your Twitter
     
  7. Daniel23

    Daniel23 Witch

    Messages:
    58
    GitHub:
    daniel23
    Yes on the twitter
     
  8. HimbeersaftLP

    HimbeersaftLP Wither Skeleton

    Messages:
    1,241
    GitHub:
    HimbeersaftLP
    1. That hasn't anything to do with Twitter lol
    2. Ouchhh my eyyeeesss
     
  9. Thunder33345

    Thunder33345 Chicken Verified

    Messages:
    1,781
    GitHub:
    Thunder33345
    sorry for going offtopic, now you mentioned it i just cant resist not saying that
    what if i want to have 100 messages? or 1 billion? hardcoding it is bad, it's very very very bad
    you should do something like
    PHP:
    $message $this->getConfig()->get('Message-'.$args[0],false);
    if(
    $message)$this->sendTweet($message);
    this way the user can have 100 or 1000 of messages as much as they can fill, also if you only want your user to only use numeric, just use a check or smth(but who dosent want shortcuts? "/tweet start" make more sense then "/tweet 1" right?)
     
    HimbeersaftLP and jasonwynn10 like this.
  10. Zayd

    Zayd Witch

    Messages:
    55
    GitHub:
    ZaydPE
  11. Thunder33345

    Thunder33345 Chicken Verified

    Messages:
    1,781
    GitHub:
    Thunder33345
    you not necessary have to create things, if you use a library like like the one you mentioned
     
    HimbeersaftLP and jasonwynn10 like this.
  12. SOFe

    SOFe A-Team Staff Member PMMP Team Poggit Admin

    Messages:
    1,248
    GitHub:
    sof3
    Also make sure you shade your libraries either manually or automatically to your namespace before releasing.
     
  13. InspectorGadget

    InspectorGadget Zombie Pigman

    Messages:
    431
    GitHub:
    InspectorGadget
    I wish Twitter has WebHooks, it's easy to transmit Data such as messages and Twitter credentials. CURL PHP function will help with that.
     
    jasonwynn10 likes this.
  14. Thunder33345

    Thunder33345 Chicken Verified

    Messages:
    1,781
    GitHub:
    Thunder33345
    i rather not, that just encourages lazy programming, see discord: even tho they have a bot API people will just use their webhook as a pmmp -> discord bridge because people are just lazy

    also read the docs, it DOES have a web HTTP based api
     
    jasonwynn10 likes this.
  15. InspectorGadget

    InspectorGadget Zombie Pigman

    Messages:
    431
    GitHub:
    InspectorGadget
    I did read the docs. I started with WebHooks and ended up with programming my own BOT with Python.
     
    jasonwynn10 likes this.
  16. SOFe

    SOFe A-Team Staff Member PMMP Team Poggit Admin

    Messages:
    1,248
    GitHub:
    sof3
    Why do you need a webhook if you just want to send messages?
     
    jasonwynn10 likes this.
  17. Zayd

    Zayd Witch

    Messages:
    55
    GitHub:
    ZaydPE
    There's one problem though. Users must create an application allowing read/write access of their Twitter account...
    So in order to do this, you must tell the user to do such and such with their account before the plugin can work properly.
     
    jasonwynn10 likes this.
  18. SOFe

    SOFe A-Team Staff Member PMMP Team Poggit Admin

    Messages:
    1,248
    GitHub:
    sof3
    Or host a website, use Twitter API webflow to redirect users to your application and give the plugin a token that executes through your website.
     
    jasonwynn10 and Zayd like this.
  19. Thunder33345

    Thunder33345 Chicken Verified

    Messages:
    1,781
    GitHub:
    Thunder33345
    Daniel23 and jasonwynn10 like this.

Share This Page