mIRC Homepage
Posted By: VenomEater Help with IRC Bot - 04/03/13 04:45 AM
Hi im making a bot for my twitch.tv stream and i will be doing giveaways but i need a command like !giveaway and i want it to pick a random name from the channel eg if theres venomeater, nyarlathotp and lagmaster i want it to randomly pick one and output to something like
[Giveaway]: <chosenname> Just won the giveaway well send you a message with details on how to obtain.
also i want it to only be used by channel operators which for twitch.tv is a mod but in the mirc it adds the @ in front of name and does have the +o flag for the channel mods so i want the !giveaway command only accesable by operators of channel and if they arent channel operator would it be able to say [CMD]: Dear $nick , You do not have permission to use this command!

Thanks in advance
Posted By: Deega Re: Help with IRC Bot - 04/03/13 03:10 PM
It's pretty similar to your other post wink
Check if $nick isop, then use $rand() and $nick(#,0)

Code:
on *:text:!giveaway:#:{
  if ($nick isop #) { [Giveaway]: $nick(#,$rand(1,$nick(#,0))) Just won the giveaway, we'll send you a message with details on how to obtain. }
  else { [CMD]: Dear $nick , You do not have permission to use this command! }
}
Posted By: Deega Re: Help with IRC Bot - 04/03/13 11:25 PM
Err... sorry, I forgot the /msg commands laugh

Code:
on *:text:!giveaway:#:{
  if ($nick isop #) { msg # [Giveaway]: $nick(#,$rand(1,$nick(#,0))) Just won the giveaway, we'll send you a message with details on how to obtain. }
  else { msg # [CMD]: Dear $nick , You do not have permission to use this command! }
}
Posted By: AlphaKennyHuan Re: Help with IRC Bot - 04/11/13 06:51 PM
would there be any way of making it so that only followers can win, or so that it says afterwards in the message if they r following or not??
Posted By: panda_jorstar Re: Help with IRC Bot - 06/11/13 12:31 PM
then you would have to make like a command that makes connection to the twitch api and reads all the follower names and saves them in an ini/text file.
and make it so the giveaway command checks if the name is on the list
Posted By: AlphaKennyHuan Re: Help with IRC Bot - 08/11/13 06:53 PM
i do not understand how i would go about doing that as i am still very new to coding
© mIRC Discussion Forums