def get_sport_update(self, _type, teams):
        try:
            res = sports.get_match(_type, teams[0], teams[1])
            rVal = SportsResult(res)
        except:
            rVal = SportsResult(err="Error made by me. Please contact me to report. Error: SPORT UPDATE ERROR")

        self.result = rVal
        return self.result
Exemple #2
0
async def football(ctx, *args):
    try:
        match = sports.get_match(sports.SOCCER, args[0], args[2])
    except:
        await ctx.send('abe shuru to hone do')
        return
    embed = discord.Embed(title=' '.join(args).upper(),
                          colour=discord.Colour.blurple())
    embed.description = f'{match.league}'
    embed.add_field(name=f'{match.away_team}', value=f'{match.away_score}')
    embed.add_field(name=f'{match.home_team}', value=f'{match.home_score}')
    await ctx.send(embed=embed)
def football_info():
	
	try:
		match = sports.get_match(sports.SOCCER, e1.get() , e2.get())
		date.set(match.match_date)
		time.set(match.match_time)
		league.set(match.league)
		team1.set(match.home_team)
		team2.set(match.away_team)
		team1_score.set(match.away_score)
		team2_score.set(match.home_score)
		link.set(match.match_link)
	except:
		messagebox.showerror("showerror", "No match found")
Exemple #4
0
def match_info():
    try:
        match = sports.get_match(sports.CRICKET, e1.get(), e2.get())
        date.set(match.match_date)
        time.set(match.match_time)
        league.set(match.league)
        team1.set(match.home_team)
        team2.set(match.away_team)
        team1_score.set(match.away_score)
        team2_score.set(match.home_score)
        link.set(match.match_link)
        season.set(match.away_score)
        season.set(match.home_score)

    except:
        messagebox.showerror("Error", "It was not a live match")
def convert_db(dictionary):
    valid_sports = {
        'cricket': 'CRICKET',
        'rugby-league': 'RUGBY_L',
        'rugby-union': 'RUGBY_U',
        'hockey': 'HOCKEY',
        'baseball': 'BASEBALL',
        'basketball': 'BASKETBALL',
        'football': 'FOOTBALL',
        'handball': 'HANDBALL',
        'soccer': 'SOCCER',
        'tennis': 'TENNIS',
        'volleyball': 'VOLLEYBALL'
    }
    for keys, values in dictionary.items():
        for teams in values:
            try:
                match_information = sports.get_match(valid_sports[keys],
                                                     teams[0], teams[1])
                print(match_information.match_date)
            except Exception as e:
                print(e)
Exemple #6
0
 async def getscore(self, ctx, sport: str, team1: str, team2: str):
     id_ = ctx.message.author.id
     if sport == 'football' or 'fb' or 'nfl':
         match_score = sports.get_match(sports.FOOTBALL, team1, team2)
         await ctx.send(f'{match_score} {ctx.message.author.mention}')
if len(argumentList) == 2:
    sport = argumentList[1].lower()
    if sport in sports_dict.keys():
        all_matches = sports.all_matches()[sport]
        for match in all_matches:
            print(match)
    else:
        print("This sport details are not supported yet")

if len(argumentList) == 3:
    sport = argumentList[1].lower()
    if (sport == "baseball" or sport == "basketball" or sport == "football"
            or sport == "hockey"):
        sport = sports_dict.get(sport)
        team = argumentList[2].lower()
        team_info = sports.get_team(sport, team)
        print(team_info)
    else:
        print("This sport details are not supported yet")

if len(argumentList) == 4:
    sport = argumentList[1].lower()
    if sport in sports_dict.keys():
        sport = sports_dict.get(sport)
        team1 = argumentList[2].lower()
        team2 = argumentList[3].lower()
        match_info = sports.get_match(sport, team1, team2)
        print(match_info)
    else:
        print("This sport details are not supported yet")
#* Code for Live cricket score Notification * ( Using plyer )

import sports
i=sports.get_match("Cricket","Team1","Team2")
import time
from plyer import notification
notification.notify(
     title="IPL Scores Updates",
     message=str(i),
     app_icon="Path of Image",
     timeout=10,
)
time.sleep(10)

#*Code for Live cricket score Notification * ( Using pynotifier )

import sports
Matchinfo=sports.get_sport("CRICKET")
from pynotifier import Notification

Notification(
     title="IPL Live score Updates",
     description=str(Matchinfo),
     duration=60,
     ).send()