forked from chanbakjsd/TerraOceanPlugin
				
			
		
			
				
	
	
		
			22 lines
		
	
	
		
			574 B
		
	
	
	
		
			Go
		
	
			
		
		
	
	
			22 lines
		
	
	
		
			574 B
		
	
	
	
		
			Go
		
	
| package modules
 | |
| 
 | |
| import (
 | |
| 	"strconv"
 | |
| 
 | |
| 	"github.com/bwmarrin/discordgo"
 | |
| 
 | |
| 	"TerraOceanBot/discord/config"
 | |
| 	"TerraOceanBot/discord/message"
 | |
| )
 | |
| 
 | |
| func createCustomEmbed(id int, name string) *message.Embed {
 | |
| 	return message.InitNewEmbed(config.CustomVoteTitle, "", config.CustomVoteColour).
 | |
| 		AddField(config.CustomVoteVoteID, strconv.Itoa(id)).
 | |
| 		AddField(config.CustomVoteContent, name)
 | |
| }
 | |
| 
 | |
| func announceCustomResult(s *discordgo.Session, id int, name string, isPositive bool) {
 | |
| 	createCustomEmbed(id, name).UpdateVoteStatus(isPositive).
 | |
| 		Send(s, config.AnnounceCustomChannel)
 | |
| }
 |