GithubHelp home page GithubHelp logo

ilyasmohamed / fut-card-creator Goto Github PK

View Code? Open in Web Editor NEW
4.0 0.0 1.0 25.49 MB

A Twitter bot written in Python which creates Fifa Ultimate Team cards when Twitter users mention it

Home Page: https://twitter.com/futcardcreator

Python 100.00%
pyton tweepy bot fifa fifa-ultimate-team

fut-card-creator's Introduction

Fifa Ultimate Team Card Creator Twitter bot

Twitter URL

A Twitter bot written in Python which uses the Tweepy library

The bot creates a Fifa Ultimate Team card when Twitter users make a request

Request Tweets must be in a specific format

Users can chose from a selection of cards, country flags and club badges which are listed in the resources section

Contents

How to tweet at the bot

In order to get the bot to generate a FUT card you must 'mention' the bot in a tweet e.g. @futcardcreator and the parameters must be in a specific format:

[Name, Position, Club Number, Country Code, Overall, PAC, DRI, SHO, DEF, PAS, PHY, Card Code, Language Code]
  • The values for PAC, DRI, SHO, DEF, PAS and PHY must be between 0 and 99 (inclusive)
  • Club number, country code and card code must be among the resources supported (resources section)
  • Language code is optional and must be one of the languages supported (supported languages)
    • If no language code is specified then English is used as the default
  • The position must be among the valid positions within the language code (valid positions for each language)

Usage

The following tweet

@futcardcreator [Messi,RW,241,AR,94,88,96,91,32,88,61,RARE_GOLD]

(along with an image of Messi attached to the tweet) will generate the card shown on the right

It is valid to add (or omit) a space after each comma between the square brackets in the request tweet e.g:

@futcardcreator [Messi, RW, 241, AR, 94, 88, 96, 91, 32, 88, 61, RARE_GOLD]

Examples with other languages

All below examples assume an image has been attached to the request tweet.

Tweet Output Card
@futcardcreator [Messi, ED, 241, AR, 99, 99, 99, 99, 99, 99, 99, TOTY, ES]
@futcardcreator [Neymar, PE, 73, BR, 99, 99, 99, 99, 99, 99, 99, HERO, PT]
@futcardcreator [Ozil, ZOM, 1, DE, 99, 99, 99, 99, 99, 99, 99, EL_MOTM, DE]
@futcardcreator [Dybala, COC, 45, AR, 99, 99, 99, 99, 99, 99, 99, MOTM, IT]
@futcardcreator [Mbappe, BU, 73, FR, 99, 99, 99, 99, 99, 99, 99, IF_GOLD, FR]

⬇️ Have a go ⬇️

Language Support

The following languages are currently supported:

Language Code
English *
Spanish ES
Portuguese PT
German DE
Italian IT

* The language code for English is EN however no language code is actually required in the tweet if you require the output image to have English text

Position Conversion

The bot is able to convert an English position to any of the other supported languages. E.g. If you request a card with the position set to RW and the language set to ES like below

@futcardcreator [Messi, RW, 241, AR, 99, 99, 99, 99, 99, 99, 99, UCL_MOTM, ES]

then the bot will convert the position to its equivalent in the chosen language and will also use the attribute labels from the chosen language in the final output image:

Positions for each language

English

English
GK
LB
LWB
CB
RB
RWB
LM
CDM
CM
CAM
RM
LW
RW
LF
CF
RF
ST

Spanish

English Spanish
GK XYZ
LB XYZ
LWB XYZ
CB XYZ
RB XYZ
RWB XYZ
LM XYZ
CDM XYZ
CM XYZ
CAM XYZ
RM XYZ
LW XYZ
RW XYZ
LF XYZ
CF XYZ
RF XYZ
ST XYZ

Portuguese

English Portuguese
GK XYZ
LB XYZ
LWB XYZ
CB XYZ
RB XYZ
RWB XYZ
LM XYZ
CDM XYZ
CM XYZ
CAM XYZ
RM XYZ
LW XYZ
RW XYZ
LF XYZ
CF XYZ
RF XYZ
ST XYZ

German

English German
GK XYZ
LB XYZ
LWB XYZ
CB XYZ
RB XYZ
RWB XYZ
LM XYZ
CDM XYZ
CM XYZ
CAM XYZ
RM XYZ
LW XYZ
RW XYZ
LF XYZ
CF XYZ
RF XYZ
ST XYZ

Italian

English Italian
GK XYZ
LB XYZ
LWB XYZ
CB XYZ
RB XYZ
RWB XYZ
LM XYZ
CDM XYZ
CM XYZ
CAM XYZ
RM XYZ
LW XYZ
RW XYZ
LF XYZ
CF XYZ
RF XYZ
ST XYZ

Image Guidelines

When making a request to the bot to generate a FUT card, you can attach an image in the request tweet which will prompt the bot to use the image in the generated FUT card.

For best results use an image with a transparent background a 1:1 aspect ratio (square format) like the example shown on the right

If you wish to use dynamic images then see (the section below)

Dynamic Images

Dynamic images are special images used on FUT cards

These cards are not the usual headshot style images used on normal FUT cards

Dynamic images can be found via a quick google search for <player name> fut png and they will usually be 485 × 567 in size

A dynamic image can be identified by the soft gradient towards the bottom of the image

In order to use a dynamic image for the creation of a FUT card make sure to use the --dynamic flag in the request tweet e.g.

@futcardcreator [Messi, RW, 241, AR, 99, 97, 99, 99, 45, 98, 85, TOTY] --dynamic

Resources

Below are the image resources (cards, club badges and country flags) which can currently be rendered.

FUT Cards

Collapsible Section

Card Name Card Code Card
Common Bronze COMMON_BRONZE
Common Silver COMMON_SILVER
Common Gold COMMON_GOLD
Rare Bronze RARE_BRONZE
Rare Silver RARE_SILVER
Rare Gold RARE_GOLD
If Bronze IF_BRONZE
If Silver IF_SILVER
If Gold IF_GOLD
Champion Bronze FC_BRONZE
Champion Silver FC_SILVER
Champion Gold FC_GOLD
Motm MOTM
Potm Premier League PL_POTM
Potm Bundesliga BL_POTM
Futties FUTTIES
Futties Winner FUTTIESW
Toty TOTY
Toty Nominees TOTY_N
Europa League EL
Europa League Motm EL_MOTM
Europa League Live EL_LIVE
Europa League Sbc EL_SBC
Europa League Tott EL_TOTT
Ucl Common COMMON_UCL
Ucl Rare RARE_UCL
Ucl Motm UCL_MOTM
Ucl Live UCL_LIVE
Ucl Sbc UCL_SBC
Ucl Tott UCL_TOTT
Fut Swap Rewards FSR
Future Stars FS
Future Stars Nominees FSN
Pro Player PP
Carniball CB
Record Breaker RB
Hero HERO
Award Winner AW
Flashback FB
Headliners HEADLINERS
Sbc SBC
Sbc Premium SBCP
Legend LEGEND

Country Flags

Collapsible Section

Country Country Code Flag
Andorra AD AD
United Arab Emirates AE AE
Afghanistan AF AF
Antigua and Barbuda AG AG
Anguilla AI AI
Albania AL AL
Armenia AM AM
Netherlands Antilles AN AN
Angola AO AO
Antarctica AQ AQ
Argentina AR AR
American Samoa AS AS
Austria AT AT
Australia AU AU
Aruba AW AW
Åland Islands AX AX
Azerbaijan AZ AZ
Bosnia and Herzegovina BA BA
Barbados BB BB
Bangladesh BD BD
Belgium BE BE
Burkina Faso BF BF
Bulgaria BG BG
Bahrain BH BH
Burundi BI BI
Benin BJ BJ
Saint Barthélemy BL BL
Bermuda BM BM
Brunei Darussalam BN BN
Bolivia, Plurinational State of BO BO
Caribbean Netherlands BQ BQ
Brazil BR BR
Bahamas BS BS
Bhutan BT BT
Bouvet Island BV BV
Botswana BW BW
Belarus BY BY
Belize BZ BZ
Canada CA CA
Cocos (Keeling) Islands CC CC
Congo, the Democratic Republic of the CD CD
Central African Republic CF CF
Congo CG CG
Switzerland CH CH
Côte d’Ivoire CI CI
Cook Islands CK CK
Chile CL CL
Cameroon CM CM
China CN CN
Colombia CO CO
Costa Rica CR CR
Cuba CU CU
Cape Verde CV CV
Curaçao CW CW
Christmas Island CX CX
Cyprus CY CY
Czech Republic CZ CZ
Germany DE DE
Djibouti DJ DJ
Denmark DK DK
Dominica DM DM
Dominican Republic DO DO
Algeria DZ DZ
Ecuador EC EC
Estonia EE EE
Egypt EG EG
Western Sahara EH EH
Eritrea ER ER
Spain ES ES
Ethiopia ET ET
Europe EU EU
Finland FI FI
Fiji FJ FJ
Falkland Islands (Malvinas) FK FK
Micronesia, Federated States of FM FM
Faroe Islands FO FO
France FR FR
Gabon GA GA
England GB-ENG GB-ENG
Northern Ireland GB-NIR GB-NIR
Scotland GB-SCT GB-SCT
Wales GB-WLS GB-WLS
United Kingdom GB GB
Grenada GD GD
Georgia GE GE
French Guiana GF GF
Guernsey GG GG
Ghana GH GH
Gibraltar GI GI
Greenland GL GL
Gambia GM GM
Guinea GN GN
Guadeloupe GP GP
Equatorial Guinea GQ GQ
Greece GR GR
South Georgia and the South Sandwich Islands GS GS
Guatemala GT GT
Guam GU GU
Guinea-Bissau GW GW
Guyana GY GY
Hong Kong HK HK
Heard Island and McDonald Islands HM HM
Honduras HN HN
Croatia HR HR
Haiti HT HT
Hungary HU HU
Indonesia ID ID
Ireland IE IE
Israel IL IL
Isle of Man IM IM
India IN IN
British Indian Ocean Territory IO IO
Iraq IQ IQ
Iran, Islamic Republic of IR IR
Iceland IS IS
Italy IT IT
Jersey JE JE
Jamaica JM JM
Jordan JO JO
Japan JP JP
Kenya KE KE
Kyrgyzstan KG KG
Cambodia KH KH
Kiribati KI KI
Comoros KM KM
Saint Kitts and Nevis KN KN
Korea, Democratic People's Republic of KP KP
Korea, Republic of KR KR
Kuwait KW KW
Cayman Islands KY KY
Kazakhstan KZ KZ
Lao People's Democratic Republic LA LA
Lebanon LB LB
Saint Lucia LC LC
Liechtenstein LI LI
Sri Lanka LK LK
Liberia LR LR
Lesotho LS LS
Lithuania LT LT
Luxembourg LU LU
Latvia LV LV
Libya LY LY
Morocco MA MA
Monaco MC MC
Moldova, Republic of MD MD
Montenegro ME ME
Saint Martin MF MF
Madagascar MG MG
Marshall Islands MH MH
Macedonia, the former Yugoslav Republic of MK MK
Mali ML ML
Myanmar MM MM
Mongolia MN MN
Macao MO MO
Northern Mariana Islands MP MP
Martinique MQ MQ
Mauritania MR MR
Montserrat MS MS
Malta MT MT
Mauritius MU MU
Maldives MV MV
Malawi MW MW
Mexico MX MX
Malaysia MY MY
Mozambique MZ MZ
Namibia NA NA
New Caledonia NC NC
Niger NE NE
Norfolk Island NF NF
Nigeria NG NG
Nicaragua NI NI
Netherlands NL NL
Norway NO NO
Nepal NP NP
Nauru NR NR
Niue NU NU
New Zealand NZ NZ
Oman OM OM
Panama PA PA
Peru PE PE
French Polynesia PF PF
Papua New Guinea PG PG
Philippines PH PH
Pakistan PK PK
Poland PL PL
Saint Pierre and Miquelon PM PM
Pitcairn PN PN
Puerto Rico PR PR
Palestine PS PS
Portugal PT PT
Palau PW PW
Paraguay PY PY
Qatar QA QA
Réunion RE RE
Romania RO RO
Serbia RS RS
Russian Federation RU RU
Rwanda RW RW
Saudi Arabia SA SA
Solomon Islands SB SB
Seychelles SC SC
Sudan SD SD
Sweden SE SE
Singapore SG SG
Saint Helena, Ascension and Tristan da Cunha SH SH
Slovenia SI SI
Svalbard and Jan Mayen Islands SJ SJ
Slovakia SK SK
Sierra Leone SL SL
San Marino SM SM
Senegal SN SN
Somalia SO SO
Suriname SR SR
South Sudan SS SS
Sao Tome and Principe ST ST
El Salvador SV SV
Sint Maarten (Dutch part) SX SX
Syrian Arab Republic SY SY
Swaziland SZ SZ
Turks and Caicos Islands TC TC
Chad TD TD
French Southern Territories TF TF
Togo TG TG
Thailand TH TH
Tajikistan TJ TJ
Tokelau TK TK
Timor-Leste TL TL
Turkmenistan TM TM
Tunisia TN TN
Tonga TO TO
Turkey TR TR
Trinidad and Tobago TT TT
Tuvalu TV TV
Taiwan TW TW
Tanzania, United Republic of TZ TZ
Ukraine UA UA
Uganda UG UG
US Minor Outlying Islands UM UM
United States US US
Uruguay UY UY
Uzbekistan UZ UZ
Holy See (Vatican City State) VA VA
Saint Vincent and the Grenadines VC VC
Venezuela, Bolivarian Republic of VE VE
Virgin Islands, British VG VG
Virgin Islands, U.S. VI VI
Viet Nam VN VN
Vanuatu VU VU
Wallis and Futuna Islands WF WF
Kosovo XK XK
Samoa WS WS
Yemen YE YE
Mayotte YT YT
South Africa ZA ZA
Zambia ZM ZM
Zimbabwe ZW ZW

Club Badges

Collapsible Section

Any help filling the cells with club names would be greatly appreciated. Raise a pull request with your changes if you'd like to help.

Club Name Club Code Badge
Arsenal 1
2
3
4
Chelsea 5
7
8
Liverpool 9
Manchester City 10
Manchester United 11
12
Newcastle United 13
14
15
17
18
19
FC Bayern Munich 21
Borussia Dortmund 22
23
25
27
28
29
31
32
33
34
36
38
39
Inter Milan 44
Juventus 45
46
47
Napoli 48
50
52
54
55
57
59
62
64
65
66
68
69
70
71
72
Paris Saint-Germain 73
74
76
77
78
80
81
82
83
86
88
89
91
92
94
95
97
106
109
110
121
127
142
143
144
149
159
160
162
165
166
167
169
171
172
175
180
184
189
190
191
192
199
200
205
206
209
210
211
212
217
219
224
226
229
230
231
232
234
236
237
Atlético Madrid 240
Barcelona 241
242
Real Madrid 243
244
245
246
247
252
254
256
260
266
267
269
271
272
278
280
294
298
299
305
306
315
319
320
322
325
326
327
346
347
357
361
378
379
393
417
418
420
422
423
433
435
436
445
448
449
450
452
453
457
459
461
462
463
467
468
469
472
477
479
480
481
483
485
487
492
503
506
518
531
543
550
561
563
573
576
605
607
614
621
634
635
650
665
666
670
673
674
680
682
687
688
689
691
693
694
695
696
697
698
700
702
703
705
708
710
711
741
742
744
749
753
819
820
822
837
838
873
894
896
897
898
900
917
918
919
920
922
982
983
1013
1028
1032
1438
1439
1445
1446
1447
1456
1463
1473
1474
1475
1477
1478
1480
1516
1524
1530
1569
1596
1715
1738
1746
1750
1757
1785
1786
1788
1790
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1806
1807
1808
1809
1813
1815
1816
1819
1823
1824
1825
1831
1832
1837
1842
1843
1844
1847
1853
1854
1860
1861
1867
1871
1873
1876
1877
1878
1879
1880
1881
1882
1884
1887
1889
1891
1893
1896
1898
1900
1903
1904
1906
1907
1909
1913
1914
1915
1917
1919
1920
1923
1925
1926
1928
1929
1930
1932
1933
1934
1935
1936
1937
1938
1939
1940
1943
1944
1945
1949
1951
1952
1954
1955
1959
1960
1961
1962
1968
1970
1971
2007
2013
2017
2045
2055
2056
10019
10029
10030
10031
10032
15005
15009
15015
15019
15029
15048
100081
100325
100409
100628
100634
100651
100765
100767
100804
100805
100831
100888
101007
101014
101020
101026
101033
101037
101041
101047
101059
101083
101084
101085
101088
101097
101099
101100
101101
101102
101103
101104
101105
101106
101112
101114
101121
101144
101145
101146
101147
101148
101149
101150
101151
110062
110066
110093
110144
110145
110147
110150
110152
110169
110178
110197
110313
110316
110329
110373
110374
110395
110396
110404
110406
110456
110468
110482
110500
110502
110556
110569
110580
110581
110588
110591
110592
110597
110636
110700
110734
110741
110745
110746
110747
110749
110765
110770
110781
110827
110831
110832
110839
110854
110890
110911
110912
110913
110929
110930
110955
110975
110977
110980
111019
111022
111035
111065
111082
111083
111086
111089
111091
111092
111138
111139
111140
111144
111235
111239
111273
111285
111327
111328
111339
111340
111379
111393
111395
111396
111397
111398
111399
111400
111434
111560
111575
111588
111651
111657
111660
111674
111678
111705
111706
111707
111708
111710
111711
111713
111714
111715
111716
111722
111723
111724
111730
111766
111768
111769
111774
111779
111817
111821
111822
111839
111928
111974
111993
112019
112026
112075
112092
112093
112096
112115
112116
112134
112139
112162
112165
112168
112172
112199
112200
112224
112254
112259
112260
112276
112378
112387
112389
112390
112391
112392
112393
112408
112409
112425
112427
112429
112444
112448
112505
112516
112523
112526
112527
112528
112531
112533
112534
112535
112537
112540
112578
112579
112584
112606
112655
112658
112668
112670
112709
112791
112828
112836
112885
112903
112970
112977
112978
112983
112990
112992
112996
113057
113142
113157
113160
113161
113173
113219
113222
113259
113458
113459
113876
113948

fut-card-creator's People

Contributors

ilyasmohamed avatar

Stargazers

 avatar  avatar  avatar  avatar

Forkers

juanka1995

fut-card-creator's Issues

Enable Concept Card

Enable the concept card but ensure that positioning issues are sorted as CC image already has line separators

Add Champions League cards

Champions league cards are in assets/19/cards. Add the functionality so the bot can render these cards with the correct fonts.

This may require re positioning elements on the card due to font change.

Add more languages

File that needs changing

Ensure that the the tuple which lists position abbreviations adheres to the format and order e.g.

'positions': ('GK',
                      'LB', 'LWB', 'CB', 'RB', 'RWB',
                      'LM', 'CDM', 'CM', 'CAM', 'RM',
                      'LW', 'RW',
                      'LF', 'CF', 'RF',
                      'ST'
                  )

NOTE: there must be a total of 17 positions

Will also need to add a language code in the language Enum

Enable more cards

Not all the fut cards are currently enabled, add some more to the bot. (See image below for reference)

image

Add the cards circled in yellow
Green = Done already

Custom Card

Add the ability for users to specify a set of colours, these colours will then be used to generate a simple custom card background. This will allow for even more personalization.

The colours will be specified as part of the request tweet e.g.

@futcardcreator [Messi,RW,241,AR,94,88,96,91,32,88,61,(Red,Blue)]
  • Will need to consider including different card shapes e.g. Common, Rare, Special

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.