Skip to content

Raffle RedV3

Redjumpman edited this page Jun 26, 2018 · 1 revision

Raffle Plugin Wiki for Red V3

Raffle

Table of Contents

Major Changes

Raffle and Lottery has been merged into one plugin. This is to help eliminate the confusion I created by having two cogs in the first place. I wanted to separate out some functionality in the beginning, but I think combining the two is better. I removed three big things: Purchasing tickets, having multiple tickets, and sending someone credits. Some of these features may say a return in the future.

  • Now displays an embed for the lottery.
  • You can set an output channel for the lottery.
  • Entries only require you to react to the embed.
  • You can set a Days on server and/or a role requirement.
  • Allows for picking multiple winners.
  • The custom msg supports markdown, so you can do things like text linking.
  • Timers are automatically restarted if the bot is shutdown/restarts or the cog is reloaded.
  • Ticket purchasing, credit prizes, and multiple entries have been removed for now.
  • You can reroll the winners of a lottery.
  • Restricted to 1 raffle per guild (for now).

Commmand List

Raffle Commands

Name Command Description
start [p]raffle start <timer> <title> Starts a raffle with a timer and sets a title.
end [p]raffle end Ends a raffle and selects a winner(s).
cancel [p]raffle cancel Ends a raffle without selecting a winner(s).
reroll `[p]raffle reroll Attempts to reroll the winners of a raffle.
version [p]raffle version Displays the current installed version of raffle.

Raffle Settings Commands

Name Command Description
channel [p]setraffle channel <channel> Sets the output channel for raffles. Will use current channel if None.
role [p]setraffle role <role> Set a role requirement for your raffles.
dos [p]raffle dos <days> Set a days on server requirement for your raffles.

Raffle Main Commands

Start

Command [p]raffle start <timer> <title>

Aliases None

Description This will start a lottery. You may only have 1 lottery active per server.

Timer accepts a integer input that represents seconds or it will take the format of HH:MM:SS. For example:

80 - 1 minute and 20 seconds or 80 seconds
30:10 - 30 minutes and 10 seconds
24:00:00 - 1 day or 24 hours

The title must be 35 characters or less.

You will then be prompted for a description. You description will respect any markdown that you type.
For example, if you are doing a giveaway the following works:

[Stardew Valley](https://stardewvalley.net/)
becomes
Stardew Valley

You may also have up to 6 winners. Please note that it will ping all 6 participants.

The lottery will end when the timer has expired, or an administrator has used the end or cancel command.

End

Command [p]raffle end

Aliases None

Description
This will end a raffle early and select the winner(s) from the current pool. This command will only end a raffle, if there is currently one active on the server. If you want to pick the winners from a lottery again, use the raffle reroll command. If you want to end a raffle, but not pick any winners then use the raffle cancel command.

Cancel

Command [p]raffle cancel

Aliases None

Description
This will end a raffle early and but does not select a winner. If you want to end a raffle early and pick a winner, use the raffle end command.

Reroll

Command [p]raffle reroll <channel> <messageid>

Aliases None

Description
This will reroll the winners from a previous lottery. The channel must can be mentioned, and the message must be the id of a matching lottery. You can use this command as often as you like, so long as the channel and message exists.

Version

Command [p]raffle version

Aliases None

Description
Displays the currently installed version of raffle. Be sure to check this repository and update often for fixes.

Raffle Settings Commands

Channel

Command [p]setraffle channel <channel>

Aliases None

Description
Sets the output channel for raffles. Running the command without passing the channel information will set it to None. When the output channel is none, raffles will be output to the channel they were created in. The default is None.

Role

Command [p]setraffle role <channel>

Aliases None

Description
Sets a role requirement for entering a raffle. The role set must be already created on the server.

NOTE Someone who doesn't have the necessary role can still react to a raffle. However, their entry will not be counted.

Days on Server

Command [p]setraffle dos <days>

Aliases None

Description
Sets a dos requirement for entering a raffle.

NOTE Someone who doesn't have the necessary days on server can still react to a raffle. However, their entry will not be counted.

Permissions

Your bot must have the following permissions:

  • Read Message History
  • Add Reactions
  • Manage Messages
  • Embed Links

If the bot is missing one of these permissions you will receive a permission error message when trying to run raffles.

FAQ

Why can I only run 1 raffle per server?

I plan to expand this in the future to support more raffles. I currently just want to see how well it survives. I want to gauge how well the bot handles the timers and then revisit this later after some time.

Will you be adding paid entries?

At a later date, but probably won't be reaction based. I'm thinking of adding a mode to support that.

Will you be adding multiple entries?

See the answer to paid entries

Can I change the time from UTC to my localtime?

Messing with time is rough. I can set it to local, but it gets messed up if you are hosting it somewhere. If you are self hosting and not using a VPN, you can change the following line:

fmt_end = time.strftime("%a %d %b %Y %H:%M:%S", time.gmtime(end))
to
fmt_end = time.strftime("%a %d %b %Y %H:%M:%S", time.localtime(end))