Question

A command to return number of tickets in the current giveaway?

  • 3 April 2020
  • 3 replies
  • 328 views

I am looking to create a command !tickets that returns the user’s amount of tickets in the current giveaway.

As far as I can see, there isn’t a built in function to do this. If I need to make a script that is fine, I’d be looking for guidance on how to do that if it is the case.

 

Example

  1. User A | 40 Tickets
  2. User B | 30 Tickets

User A types !tickets in chat.

  • Bot responds with User A | 40 Tickets in Giveaway

Streamer types !tickets User B in chat.

  • Bot responds with User B | 30 Tickets in Giveaway

Variables & Functions

  • userTickets - Number of tickets user currently has in giveaway
  • maxTickets - Maximum number of tickets possible in giveaway
  • ticketCost - Cost of a single Ticket

 

  • checkPermission() - checks that the user of the command has correct permission to join the giveaway. Returns a message if they don’t.
  • atMaxTickets() - checks if user already has maximum entries possible in giveaway, and sends a message back if they do.
  • checkCurrency() - checks if the user has sufficient currency to get the desired amount of tickets. Returns a message if they do not have sufficient currency.

There might possibly be more variables and functions, and I’m open to making this into a discussion within the community if needs be. Or paying for custom work. But a boilerplate Python Script that queries the Giveaway table would be a good start.

Thanks in advance!

 

Kindest regards,

BanticsTV || https://www.twitch.tv/banticstv


This topic has been closed for comments

3 replies

Userlevel 5

Hey @BanticsTV,

While I cannot provide a direct answer for this, perhaps the Chatbot discord could help! You can search through many questions and responses there. Good luck with this project!
https://discord.gg/xFcsxft

I appreciate the response thank you. I’ll post it to them again and see if anyone new can shine a light on it! 

Userlevel 5

To anyone else that may happen to see this thread:

If you are in need of further assistance, please join us on discord or submit a ticket.

Tickets: https://support.streamlabs.com/hc/en-us/requests/new

Thanks!