Author Topic: Command to be run only once by each user  (Read 1307 times)

0 Members and 1 Guest are viewing this topic.

TheSyntox

  • Youngling
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
  • Twitch Name: The_Syntox
Command to be run only once by each user
« on: March 28, 2017, 02:24:39 AM »
Hi,

Just wondering, is it possible to set a command that can be used only once by user?
My aim is to have two commands activating VIP. One normal to extend VIP for month and one for half price that can be used for points given after following for 14days s trial. I would like this command to be run only once so viewers have to use main command to extend VIP.

Another way to achieve this would be to set VIP status in follow notification options but it's not possible at the moment.

TheNumbLock

  • Advisor
  • Councilor
  • **
  • Posts: 4776
  • Karma: +137/-5
    • View Profile
  • Twitch Name: TheNumbLock
Re: Command to be run only once by each user
« Reply #1 on: March 28, 2017, 06:37:23 AM »
Absolutely. You would most likely have to use @savefile@ to save a name to a folder. Then use @readfile@ when someone uses the command to check if there is a .txt file with their name. So would make use of @if@.

You can actually initiate commands in follower notification options > Channel Message section.
Old Name: RepentGamingTV
Twitch: Here

Need help ASAP?
Join Deepbot's Discord: Discord.Deepbot.tv
Deepbot's Twitter: @DeepSupport

TheSyntox

  • Youngling
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
  • Twitch Name: The_Syntox
Re: Command to be run only once by each user
« Reply #2 on: March 30, 2017, 04:52:23 PM »
That's looking good! Many thanks TheNumbLock, will give it a try later on.

TheSyntox

  • Youngling
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
  • Twitch Name: The_Syntox
Re: Command to be run only once by each user
« Reply #3 on: September 14, 2017, 05:06:08 PM »
Unfortunately I wasn't able to set it up. Not sure should I save txt file for each user like user1.txt, user2.txt or save all user names into one txt file. Also how would I use @IF@ so bot checks if file/name exists and says something like "Sorry this command can be user only once" or else assigning VIP to the user and takes points.
Ideally would be to have a option like this on the message to run once and have a alternate text in case msg was run for the user.